Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.