envexlabs Posted October 17, 2007 Share Posted October 17, 2007 Hey, $newsletter[6] = "2007-10-17" When i execute this code: echo date("D, d F Y", $newsletter[6]); I get this: Wed, 31 December 1969 Am i doing something wrong? Thanks, Envex Link to comment https://forums.phpfreaks.com/topic/73704-date-problem/ Share on other sites More sharing options...
corbin Posted October 17, 2007 Share Posted October 17, 2007 Date takes a unix timestamp as the second parameter.... Try looking into strtotime then passing the return from that into date as the second param. Link to comment https://forums.phpfreaks.com/topic/73704-date-problem/#findComment-371884 Share on other sites More sharing options...
atlanta Posted October 17, 2007 Share Posted October 17, 2007 not at my PHP computer to test this out but just a theory will test it out later on to see if it works ... but a shot in the dark. $newsletter[6] = "2007-10-17" $basedate = strtotime($newsletter[6]); echo date("D, d F Y", $basedate); let me know .. Link to comment https://forums.phpfreaks.com/topic/73704-date-problem/#findComment-371925 Share on other sites More sharing options...
corbin Posted October 17, 2007 Share Posted October 17, 2007 Wed, 17 October 2007 You were missing a semi colon the first line.... Just tested it just to make sure.... Appears to be correct ;p. Link to comment https://forums.phpfreaks.com/topic/73704-date-problem/#findComment-371927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.