Page 1 of 1
convert date
Posted: Mon Mar 08, 2004 10:23 am
by cto1mac
How do I convert a date 12 September 2003 to the day of the year?? I know that if I use date("z") that it will give me current day of the year but I need to convert find out how to convert that day to the long date and vice versa.
Thanks
Posted: Mon Mar 08, 2004 11:50 am
by liljester
give expamples... is the date in a database?
Posted: Mon Mar 08, 2004 11:55 am
by andre_c
Try something like this:
Code: Select all
date('d', strtotime('12 September 2003'))
if you want the 'day of the year' you will probably have to do some more calculations. If it's from a mysql database, I believe that you can that format using the date/time functions in the mysql manual
Posted: Mon Mar 08, 2004 2:48 pm
by pickle
date('z',strtotime('12 September 2003')) should give you the day of the year of Sept. 12, 2003.