Hi friends in my webpage i need to calculate the day[ie. SUN,MON,TUE...] from the date .. The date is in ['06/22/2009'] this format ? How can i calculate it in to day[That is it will show me MON] in php . Please help me to find out . Thanks in advance..
+1
A:
Use the date http://au.php.net/manual/en/function.date.php and strtotime http://au.php.net/strtotime functions
Charles Ma
2009-06-30 07:21:07
+7
A:
First, you need to parse the string '06/22/2009' into a timestamp, possibly using strtotime()
:
$dt = strtotime('06/22/2009');
Then, you can format the timestamp using date()
:
$day = date("D", $dt);
If you especially want it in uppercase, use strtoupper()
:
print strtoupper($day);
harto
2009-06-30 07:26:08