HCProfessionals Posted March 19, 2011 Share Posted March 19, 2011 I have the date stored as: date( "d/m/Y" ) After it's pulled from the database, I would like it to display like: date( "F j, Y" ) I have tried below, but the output makes d the month and m the day. $dateStamp = strtotime($row['startrepeat']); $dateFormatted = date("F j, Y", $dateStamp); Link to comment https://forums.phpfreaks.com/topic/231088-date-time-formatting-after-pulled-from-database/ Share on other sites More sharing options...
Pikachu2000 Posted March 19, 2011 Share Posted March 19, 2011 The time should be stored in the YYYY-MM-DD format, in a field with the appropriate data type. What you have above isn't a date as far as the DB and php are concerned, it's a string. Is it too late to change the database so it's set up properly? Link to comment https://forums.phpfreaks.com/topic/231088-date-time-formatting-after-pulled-from-database/#findComment-1189489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.