Try:
values(hex(generate_unique()),timestamp(generate_unique()))
From: rob@xxxxxxxxx
To: midrange-l@xxxxxxxxxxxx
Date: 11/10/2015 04:08 PM
Subject: DB2: Generating epoch time
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Is there some way to generate the epoch time in SQL?
I tried
values generate_unique()
but that was blank.
And I tried the ancient
select generate_unique() from sysibm.sysdummy1
but that worked the same
I took a wag at
values cast(generate_unique() as char(30))
but that wasn't any better.
This was a little different
values generate_unique(), timestamp(generate_unique())
....+....1....+....2....+.
VALUES
++++++++++++++++++++++++++
2015-11-10-21.04.02.786923
******** End of data ***
Before I never even got the plus signs.
I was pointed to this epoch site by IBM
http://www.epochconverter.com/?cm_mc_uid=04943014784214468222669&cm_mc_sid_50200000=1447188011
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.