Jump to content

Date & Time Formatting after pulled from database


HCProfessionals

Recommended Posts

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);

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.