gazalec Posted April 4, 2007 Share Posted April 4, 2007 Hi i was wondering if anyone knew if there was a way to convert a MySQL Date (yyyy-mm-dd) to a PHP day of the year date(z); as in like January the first would be day 1 (or 0 ???) Thanks for any help Link to comment https://forums.phpfreaks.com/topic/45582-converting-mysql-date-to-php-day-of-the-year/ Share on other sites More sharing options...
kenrbnsn Posted April 4, 2007 Share Posted April 4, 2007 Use the strtotime() function: <?php $date_str = "2007-04-09"; echo date('z',strtotime($date_str)); ?> Ken Link to comment https://forums.phpfreaks.com/topic/45582-converting-mysql-date-to-php-day-of-the-year/#findComment-221336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.