On 16 May 2007 08:50:02 -0700,
EMAIL REMOVED wrote:
> Hi,
>
> I have a query re' the TIMESTAMP format.
>
> I've set up identical tables on my DOS machine (Win.XP), and also on
> my Linux box. Nothing fancy, just a few fields, two of which are
> TIMESTAMP fields. These are set up as follows:
>
> MYDATE1 TIMESTAMP NOT NULL,
> MYDATE2 TIMESTAMP
>
> Each table works fine on both the DOS box and the Linux box.
>
> However, on the DOS box the dates are stored without hyphens, but on
> the Linux box the dates are stored with hyphens.
>
> eg DOS = 20070508112803
> Linux= 2007-05-16 08:32:56
>
> This is a problem because my scripts ***ume the first format, although
> the probem is really that the formats are different - either one I can
> live with, just so long as they are the same.
>
> I'm guessing there must be some way to get MySQL to store the
> TIMESTAMP field, and for that matter DATE fields, in a certain format,
> but I have found nothing to help me so far.
You don't need to worry about how it's stored. MySQL will take DOS's
format[1] and there's an indication from a user note that adding '+0' to
the name of the column will have the timestamp read out without
delimiters[2].
[1]
http://dev.mysql.com/doc/refman/5.0/en/datetime.html
[2]
http://dev.mysql.com/doc/refman/5.0/...stamp-4-1.html
--
29. I will dress in bright and cheery colors, and so throw my enemies into
confusion.
--Peter Anspach's list of things to do as an Evil Overlord