View Single Post

  #1 (permalink)  
Old 05-16-2007
janedunnie@gmail.com
 
Posts: n/a
Default MYSQL TIMESTAMP Format - DOS / Linux

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 assume 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.

Any information re' resolving this would be gratefully received.

Thanks!
Jane

Reply With Quote