Jump to content

Date formatting question


BarneyJoe

Recommended Posts

Hopefully a quick question on date formatting...

 

Basically I have a few date fields in a table - last updated, next check due etc.

 

There's also a DateAdded field which defaults to the date the record was created. The default format was 2008-01-01, but I've got that displaying using a recordset in Dreamweaver :

 

SELECT date_format(DateAdded, '%%D %%b %%Y') as formatted_date FROM developments WHERE DevelopmentID = %s", $colname_dateformat1);

 

This is fine.

 

Following this principle I've done another couple for other dates and dropped them in. For dated I'd already added in the 2008-01-01 format, they display correctly.

 

But my problem now is with entering them - as far as I can tell I'm drawing a blank with either

 

2008-01-01 or '%%D %%b %%Y'

 

What's the best practice for entering them in the first place?

 

Cheers,

Link to comment
https://forums.phpfreaks.com/topic/64092-date-formatting-question/
Share on other sites

OK solved the first part.

 

And I've just put (YYYY-MM_DD) in brackets by the date fields, so I guess that'll do.

 

I guess as a non techie coming from an Access background, I'm used to it automagically changing pretty much anything entered into the format for the field.

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.