Avatar of italoestrada
italoestradaFlag for Panama

asked on 

How can I convert in db2 from unix epoch to normal timestamp?

I am trying to convert unix epoch time, to regular time stamp in db2.
DB2

Avatar of undefined
Last Comment
italoestrada
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

you can do
 '1970.01.01 00.00.00.000000' + epohch_column seconds

that will give you a db2 timestamp
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of italoestrada
italoestrada
Flag of Panama image

ASKER

momi_sabag:
i try
date('1970-01-01-00.00.00.000000' ) + epoch seconds
but the epoch in seconds is not the same type than date....
thats why is not working......
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

epoch is the number of seconds since 01.01.1970 midinght so if you add that to the that date, it should provide you with the right answer
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

whats wrong with that solution?
Avatar of italoestrada
italoestrada
Flag of Panama image

ASKER

my mistake i didnt read that well,,,  i read that + (epoch seconds) was my variable,
now i see than is + (epoch) seconds,,,,

my bad,, thanks for your answer.......
Avatar of italoestrada
italoestrada
Flag of Panama image

ASKER

Thas the correct anwer... thanks a lot...
DB2
DB2

IBM DB2 is a family of relational database server products developed by IBM that have been extended to support object-relational features and non-relational structures like JSON and XML. There are three main products in the DB2 family: DB2 for Linux, UNIX and Windows (informally known as DB2 LUW), DB2 for z/OS (mainframe), and DB2 for i (formerly OS/400), plus a version for IBM's Virtual Storage Extended (VSE) operating system.

6K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo