Click to See Complete Forum and Search --> : Date format


Terrorke
02-20-2009, 08:22 AM
Hi,

Can anybody tell me how to convert this dateformat into another dateformat in MSSQL 2K?

The format of the data is : '20071015122532Z'

Thanks in advance.

Kind regards,

criterion9
02-20-2009, 09:58 AM
What is the datatype of the column in question? DATE, TIMESTAMP, etc? Without knowing that a string of numbers and letters doesn't help much.

Terrorke
02-23-2009, 01:39 AM
I think it is a timestamp.
But I'm not sure because I get the data from a export file of a Java environement.

Phill Pafford
02-25-2009, 09:18 AM
Hmm looks like it's

YYYYMMDDHHMMSS the z could be a country code or something
20071015122532Z

You could just take the substring of 14 (20071015122532) and convert it this way, don't know if you need the Z though.

felgall
02-25-2009, 07:42 PM
Z is a common abbreviation for zulu (also known as UTC or GMT)

Terrorke
02-26-2009, 01:11 AM
Thanks!
I will try this and just skip the Z in it.