MS SQL Date

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Hey chaps

Currently have an SQL server using US date format. Once before i have somehow changed my SQL database to use the british date time format (dd/mm/yyyy) but i cant remember how

I know i can convert the date at query level but i dont want that, i want to store the dates in the right format and change the currently stored dates to the british way.

Im sure i ran something in Query Analyzer which ammended the format

Anyone know anything about this?

ta
 

Gef

Fledgling Freddie
Joined
Jan 9, 2004
Messages
570
If your using the 'datetime' datatype then it simply stores a real date and time, its only enterprise manager thats displaying it in the US format. Whats actually stored (when not converted to a string) is something like "2006-01-03T16:45:56.0000000-00:00" which is no real format at all. Its up to you how you display it on your web page.

Using XSL you can use the formatdate function to write it out however you like. i.e "date:formatdate(DateFieldName, 'dddd dd MMMM yyyy')" would write out: Tuesday 03 January 2006

Hope that helped some?
 

Panda On Smack

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,030
Ahh so its speciic to the maching im running Enterprise Manager on?

that makes sense because when i Remote Desktop to the server in the US and check the tables thats when i noticed the date is wrong, ive just connected from home and the date is UK format

Thanks dude
 

Gef

Fledgling Freddie
Joined
Jan 9, 2004
Messages
570
Yep its just enterprise managers interpritation of the actual saved data, you can change it in the options. Its just that '10/10/06 16:46' is easier to read than '2006-01-03T16:45:56.0000000-00:00'
 

Gef

Fledgling Freddie
Joined
Jan 9, 2004
Messages
570
Try doing a google for "SET DATEFORMAT" (I think)
 

Users who are viewing this thread

Top Bottom