Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to convert Unix Time Stamp

Hi,

I have a database with one of the fields "Receiveddata" in format like:

1014937200

1025521200

etc...

In Epoch Converter we have...

1025521200        

MT: Thu, 28 Feb 2002 23:00:00 GMT
Your time zone: ‎01‎.‎03‎.‎2002‎ ‎1‎:‎00‎:‎00 GMT+2:00

help me please, to convert to the Human date...

"ODBC CONNECT TO ...............................

LOAD RECEIVEDDATE,
TYPE,
Date('RECEIVEDDATE','MM/DD/YYYY') as RECEIVEDDATE1;              (is not working...)

SQL SELECT RECEIVEDDATE,
TYPE,

............"

is not working...

12 Replies
PrashantSangle

Hi,

Try,

Date(RECEIVEDDATE,'MM/DD/YYYY') as RECEIVEDDATE1

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

also refer below thread

Julian Date conversion in the script

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

jonathandienst
Partner - Champion III

If this is based on the Unix epoch, then perhaps this:

     =Date(Date#('19700101', 'YYYYMMDD') + (Receiveddata / 86400))

     or

     =TimeStamp(Date#('19700101', 'YYYYMMDD') + (Receiveddata / 86400))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
avinashelite

try like this:

timestamp((timecompleted/ 86400 + 25569),'DD MMM YYYY h:mm:ss[.fff] TT'))

Not applicable
Author

SQL##f - SqlState: S1000, ErrorCode: 936, ErrorMsg: [Oracle][ODBC][Ora]ORA-00936: missing expression

SQL SELECT RECEIVEDDATE,
    TYPE,

.....

jonathandienst
Partner - Champion III

The expression must be in the QV part of the LOAD, not the SQL part:

LOAD RECEIVEDDATE As UNIXDATE,

TYPE,

Date(Floor(Date#('19700101', 'YYYYMMDD') + (RECEIVEDDATE / 86400)) as RECEIVEDDATE;            

...

SQL SELECT RECEIVEDDATE,

TYPE, 

... 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thank You-It's fine

Kushal_Chawda

try this,

=timestamp((YourDateField/(24*60*60)) + (2 + date#('1/1/1970') - date#('1/1/1900')),'DD/MM/YYYY hh:mm:ss')