DB2 and timestamps

Dylan Vanderhoof

DB2 and timestamps
Hello all,
This is probably something obvious and well documented, but I'm not
seeing it anywhere.
Is there a way to have the DBM convert a DB2 timestamp into a UNIX
timestamp? (longint seconds since Jan 1, 1970)

I would use timestampdiff(), but that functions apparently makes some
assumptions that will skew the resulting timestamp rather badly.

-D

-----------------------------------------------------------------------
Dylan C. Vanderhoof
Software Developer
Semaphore Corporation
http://www.semaphore.com/
perl -e "print(pack('h38','c6c616279616e604c6c616279616e6e2e65647'))"

"Its always a long day. 86400 doesn't fit into a short."

PGP Fingerprint -- 6F06 CD8B EC34 706B 2B18 3F19 EF3F A888 232A BCC2

-----------------------------------------------------------------------



James Campbell

Re: DB2 and timestamps
(in response to Dylan Vanderhoof)
(days(current date) - days('1970-01-01')) * 86400 + midnight_seconds(current
time)
?

/* standard disclaimer */
James Campbell
DBA
Hansen Corporation, Doncaster
+61 3 9843 8442
[login to unmask email]
-----Original Message-----
From: Dylan Vanderhoof [mailto:[login to unmask email]
Sent: Tuesday, January 09, 2001 11:27 AM
To: [login to unmask email]
Subject: [DB2-L] DB2 and timestamps


Hello all,
This is probably something obvious and well documented, but I'm not
seeing it anywhere.
Is there a way to have the DBM convert a DB2 timestamp into a UNIX
timestamp? (longint seconds since Jan 1, 1970)

I would use timestampdiff(), but that functions apparently makes some
assumptions that will skew the resulting timestamp rather badly.

-D

-----------------------------------------------------------------------
Dylan C. Vanderhoof
Software Developer
Semaphore Corporation
http://www.semaphore.com/
perl -e "print(pack('h38','c6c616279616e604c6c616279616e6e2e65647'))"

"Its always a long day. 86400 doesn't fit into a short."

PGP Fingerprint -- 6F06 CD8B EC34 706B 2B18 3F19 EF3F A888 232A BCC2

-----------------------------------------------------------------------







**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************