Groups | Blog | Home
all groups > sql server programming > january 2005 >

sql server programming : Convert TIMESTAMP to GMT?


clintonG
1/11/2005 7:08:50 PM
My application will write XML to the database and I'm wondering if it is
feasible to use a SQL2000 TIMESTAMP to record the lastBuildDate that
indicates when an RSS channel was last edited. The RSS specifications [1]
however require lastBuildDate to be formatted as: Sat, 07 Sep 2002 09:42:31
GMT. I would need to convert the value of the TIMESTAMP when the XML stored
in the database was retrieved. Comments?

--
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

[1] http://blogs.law.harvard.edu/tech/rss#optionalChannelElements



Aaron [SQL Server MVP]
1/11/2005 8:23:55 PM
[quoted text, click to view]

(a) TIMESTAMP has absolutely nothing to do with date or time. You cannot
"convert" a TIMESTAMP value to anything meaningful to an end user, because
no date or time components are encoded in the value (see now why ROWVERSION
is a better name for this datatype?) :-)

(b) You can use DATETIME (or SMALLDATETIME if you don't care about seconds),
and you can easily convert to GMT as long as you know your offset (or can
calculate it at runtime, or pre-populate a calendar table of some sort).

Some information on (a) that might be useful:
http://www.aspfaq.com/2448

Some information on (b) that might be useful:
http://www.aspfaq.com/2218
http://www.aspfaq.com/2519

MGFoster
1/12/2005 1:49:00 AM
[quoted text, click to view]

A Windows OS on a PC or server keeps system time in GMT. You can use
the GetSystemTime API call in another programming language. See any
websites, books about the GetSystemTime API call.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
clintonG
1/12/2005 10:59:18 AM
Thank you for your comments.
I thought I had another good idea without understanding the entire context.
I'll handle this in the application code.

<%= Clinton Gallagher

[quoted text, click to view]

clintonG
1/12/2005 11:03:13 AM
Thank you for your comments Aaron.
I hadn't been to the FAQ for awhile and returned this morning trying to use
the search function to look for date into before returing here. I sent you
comments in that regard.

I've just loaded the articles you referred and I'm sure I'll always have
something to learn from the ASP FAQ. Thank you.

<%= Clinton Gallagher

[quoted text, click to view]

AddThis Social Bookmark Button