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 Quote 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. Quote 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 .. Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/73704-date-problem/#findComment-371927 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.