[resolved] Unix date to normal date (tmap)

One Star

[resolved] Unix date to normal date (tmap)

I have a Unix date and want to convert it to a normale Date
for example: 13959.583 -> what will be 21.03.2008 13:59:31

can anyone help me?
Thanks Florian

Accepted Solutions
Community Manager

Re: [resolved] Unix date to normal date (tmap)

Hello
If the unix Dates is 13959.583, the really human date shoule be: 01.01.1970 04:52:39, you can convert it on website: http://www.epochconverter.com/
I wonder how do you convert it to 21.03.2008 13:59:31 with other tools or is there some relationship between 13959.583 and 21.03.2008 13:59:31?
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] Unix date to normal date (tmap)

Hello
Using the following code:
new java.util.Date((long)(row1.unixDate*1000))

Input file:

13959.583
123451254
232012.2132

Result:
Starting job test at 11:17 09/04/2009.
.-------------------.
| tLogRow_1 |
|=-----------------=|
|date |
|=-----------------=|
|01.01.1970 11:52:39|
|30.11.1973 04:00:54|
|04.01.1970 00:26:52|
'-------------------'
Job test ended at 11:17 09/04/2009.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Unix date to normal date (tmap)

Hello, thanks for that help, my Unix date is a float, can you help me please?
It's called SOLL_START Type: float length: 15 precision:10
It is possible to convert that to Double
Community Manager

Re: [resolved] Unix date to normal date (tmap)

Hello friend
You only need to select fload to replade double when defining the schema.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Unix date to normal date (tmap)

That are my Unix Dates in float:
13959.583
13964.261
13958.415
And that is, what I get as date:
01.01.1970 04:52:39
01.01.1970 04:52:44
01.01.1970 04:52:38
And it should be:
21.03.2008 13:59:31
26.03.2008 06:15:50
20.03.2008 09:57:36
So, I need some help please
Thanks Florian
Community Manager

Re: [resolved] Unix date to normal date (tmap)

Hello
If the unix Dates is 13959.583, the really human date shoule be: 01.01.1970 04:52:39, you can convert it on website: http://www.epochconverter.com/
I wonder how do you convert it to 21.03.2008 13:59:31 with other tools or is there some relationship between 13959.583 and 21.03.2008 13:59:31?
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Unix date to normal date (tmap)

Ok, I asked a developer at my company and he had a java class for me, so thanks for your help