Get Day

code PHP

public static function getNameDayJapanese()
   {
     $jd = cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
     switch ($id){
       case 0:
         return "日";
         break;
       case 1:
         return "月";
         break;
       case 2:
         return "火";
         break;
      case 3:
        return "水";
        break;
      case 4:
        return "木";
        break;
      case 5:
        return "金";
        break;
      case 6:
        return "土";
        break;
      default:
       return '';
   }
 }

Code Javascript

function getDayOfWeek()
{
 var dteNow = new Date();
 var dteToday = dteNow.getDay();
 var strDay = '';
   
 switch(dteToday)
 {
   case 0: strDay =  '日'; break;
   case 1: strDay =  '月'; break;
   case 2: strDay =  '火'; break;
   case 3: strDay =  '水'; break;
   case 4: strDay =  '木'; break;
   case 5: strDay =  '金'; break;
   case 6: strDay =  '土'; break;
   default:  strDay = '';
 }
 return strDay;
}

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: