Jump to content

Inserting the date


LanceT

Recommended Posts

What's important is almost always how the date is formatted when it's displayed.  Provided that you store something rational in an appropriate datatype field, you should have no problems in converting it to whatever date display format you want ... and you'll be able to process records in your database by date as and when it's necessary.
Link to comment
Share on other sites

thats not really my problem, but I want it to insert TODAY's current date. I know that I could insert 12707 and format it to January 27, 2007, but I want it to be able to recognize what today's current date is.

So are you saying this is possible with the curdate() function or what?
Link to comment
Share on other sites

[quote author=SweetLou link=topic=124488.msg517541#msg517541 date=1170199366]
Never have used TIMESTAMP, but why not?
[/quote]
First, the date range is limited, so that's annoying -- second, it has also sorts of magical, half-documented and entirely undesirable features.  Third, DATETIME is just more logical for so many reasons.

[quote author=LanceT link=topic=124488.msg517566#msg517566 date=1170202633]
[quote author=fenway link=topic=124488.msg517274#msg517274 date=1170181657]
1) Never use TIMESTAMP.
2) The MySQL date format is SQL-99 standard -- and you always want that format... ALWAYS!
[/quote]

what is SQL-99 standard?
[/quote]

YYYY-MM-DD... not only is it the only unambigious format, but it also sorts lexically.
Link to comment
Share on other sites

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.