dbTalk Databases Forums  

Date formats - what do other people use??

comp.databases comp.databases


Discuss Date formats - what do other people use?? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Rogerson
 
Posts: n/a

Default Date formats - what do other people use?? - 01-16-2008 , 06:39 AM






In Microsoft SQL Server unfortunetly the only consistent date format is
YYYYMMDD, this is legacy from Sybase original code apparently; using
YYYY-MM-DD is converted as YYYY-DD-MM in many localised SQL Server installs
(us_english is fine, other languages even British aren't).

What formats do other people use? Presumeably ISO 8601 (of course), but is
the normal consensus YYYYMMDD or the display friendly YYYY-MM-DD which we
cannot use reliably in SQL Server.

I guess my absolute question is - do most databases support YYYYMMDD so when
it comes to portability there is no problems?

Background:
http://sqlblogcasts.com/blogs/tonyro...h-october.aspx

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]



Reply With Quote
  #2  
Old   
David Cressey
 
Posts: n/a

Default Re: Date formats - what do other people use?? - 01-16-2008 , 07:49 AM







"Tony Rogerson" <tonyrogerson (AT) torver (DOT) net> wrote

Quote:
In Microsoft SQL Server unfortunetly the only consistent date format is
YYYYMMDD, this is legacy from Sybase original code apparently; using
YYYY-MM-DD is converted as YYYY-DD-MM in many localised SQL Server
installs
(us_english is fine, other languages even British aren't).

What formats do other people use? Presumeably ISO 8601 (of course), but is
the normal consensus YYYYMMDD or the display friendly YYYY-MM-DD which we
cannot use reliably in SQL Server.

I guess my absolute question is - do most databases support YYYYMMDD so
when
it comes to portability there is no problems?

Background:

http://sqlblogcasts.com/blogs/tonyro...h-october.aspx

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


A format I've seen several times is YYYY.MM.DD

The use of periods instead of hyphens helps disambiguate it from YYYY-DD-MM.

Another: MM-DD-YYYY.

Another: DD-MON-YYYY eg. 17-DEC-2007 uses month names instead of numbers.

I'm not endorsing any of these. I'm just saying I've seen them.

One test for me is to see what the "table data import" wizard in MS Access
does with the format. If the wizard figures out that the item is a date,
and converts all the dates correctly, that's one argument in favor of the
format.







Reply With Quote
  #3  
Old   
David Cressey
 
Posts: n/a

Default Re: Date formats - what do other people use?? - 01-16-2008 , 07:49 AM




"Tony Rogerson" <tonyrogerson (AT) torver (DOT) net> wrote

Quote:
In Microsoft SQL Server unfortunetly the only consistent date format is
YYYYMMDD, this is legacy from Sybase original code apparently; using
YYYY-MM-DD is converted as YYYY-DD-MM in many localised SQL Server
installs
(us_english is fine, other languages even British aren't).

What formats do other people use? Presumeably ISO 8601 (of course), but is
the normal consensus YYYYMMDD or the display friendly YYYY-MM-DD which we
cannot use reliably in SQL Server.

I guess my absolute question is - do most databases support YYYYMMDD so
when
it comes to portability there is no problems?

Background:

http://sqlblogcasts.com/blogs/tonyro...h-october.aspx

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


A format I've seen several times is YYYY.MM.DD

The use of periods instead of hyphens helps disambiguate it from YYYY-DD-MM.

Another: MM-DD-YYYY.

Another: DD-MON-YYYY eg. 17-DEC-2007 uses month names instead of numbers.

I'm not endorsing any of these. I'm just saying I've seen them.

One test for me is to see what the "table data import" wizard in MS Access
does with the format. If the wizard figures out that the item is a date,
and converts all the dates correctly, that's one argument in favor of the
format.







Reply With Quote
  #4  
Old   
David Cressey
 
Posts: n/a

Default Re: Date formats - what do other people use?? - 01-16-2008 , 07:49 AM




"Tony Rogerson" <tonyrogerson (AT) torver (DOT) net> wrote

Quote:
In Microsoft SQL Server unfortunetly the only consistent date format is
YYYYMMDD, this is legacy from Sybase original code apparently; using
YYYY-MM-DD is converted as YYYY-DD-MM in many localised SQL Server
installs
(us_english is fine, other languages even British aren't).

What formats do other people use? Presumeably ISO 8601 (of course), but is
the normal consensus YYYYMMDD or the display friendly YYYY-MM-DD which we
cannot use reliably in SQL Server.

I guess my absolute question is - do most databases support YYYYMMDD so
when
it comes to portability there is no problems?

Background:

http://sqlblogcasts.com/blogs/tonyro...h-october.aspx

Tony.

--
Tony Rogerson, SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson
[Ramblings from the field from a SQL consultant]
http://sqlserverfaq.com
[UK SQL User Community]


A format I've seen several times is YYYY.MM.DD

The use of periods instead of hyphens helps disambiguate it from YYYY-DD-MM.

Another: MM-DD-YYYY.

Another: DD-MON-YYYY eg. 17-DEC-2007 uses month names instead of numbers.

I'm not endorsing any of these. I'm just saying I've seen them.

One test for me is to see what the "table data import" wizard in MS Access
does with the format. If the wizard figures out that the item is a date,
and converts all the dates correctly, that's one argument in favor of the
format.







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.