mysty Posted March 23, 2007 Share Posted March 23, 2007 <?php echo $_SESSION['MY_date'] ?> This is line of code that gets a date from a session variable. The session variable, MY_date, comes from a database DATE field. The output is like this: 2007-01-01. What I want the output to look like is this: January 1, 2007. How do I do that? or what changes are needed in the above code? Quote Link to comment Share on other sites More sharing options...
JSHINER Posted March 23, 2007 Share Posted March 23, 2007 Just had the same issue: echo date("F j, Y",strtotime($_SESSION['MY_date'])); Quote Link to comment Share on other sites More sharing options...
SharkBait Posted March 23, 2007 Share Posted March 23, 2007 echo date("F d, Y", strtotime($_SESSION['MY_date'])); bah I was beaten to it! Quote Link to comment Share on other sites More sharing options...
mysty Posted March 23, 2007 Author Share Posted March 23, 2007 Thanks guy, it works like a charm. Quote Link to comment Share on other sites More sharing options...
Kasuke_Akira Posted March 23, 2007 Share Posted March 23, 2007 Wow, that would make things eaasier. all u have to do is store one format and u can convert it to any you need. Quote Link to comment 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.