convert unix timestamp to different time zone

One Star

convert unix timestamp to different time zone

Hi All,
we have csv file.
ts
1390207663
1390208083
1390208383
1390208743
we want to convert timestamp values to another timezone timestamp?

Thanks in advance
vicky
Seventeen Stars

Re: convert unix timestamp to different time zone

Keep in mind: a UNIX timestamp is simply the amount of milliseconds until the 01.01.1970 00:00:00.000
If you want to move it one hour later you have to add (1*60*60*1000) to your long typed timestamp.
One of the problem is to know from which timezone is your timestamp.
One Star

Re: convert unix timestamp to different time zone

hi vicky,
first convert your string variables to double .
using Double.parseDouble(column_name)
then in tmap you can directly use the below expression to get date
:
new java.util.Date((long)(Column_Name*1000))
the above expression will convert your unix date into actual date pattern.
please let me know incase of any doubts.
with regards,
Akash S.
Five Stars ami
Five Stars

Re: convert unix timestamp to different time zone

Hello,
I  want to convert the unix timestamp  1443696342801  into date ,
i am new to Talend , i converted  1298226724 into date using  below logic , please see below attach screen shots:


But i am unable to convert this number 1443696342801  
any suggestion will be helpfull
its little urgent 
thanks
Amit

Moderator

Re: convert unix timestamp to different time zone

Hi Amit,
We have replied to your another topic:https://www.talendforge.org/forum/viewtopic.php?id=47516. Could you please take a look at it?
Let us know if it is Ok with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars ami
Five Stars

Re: convert unix timestamp to different time zone

Dear Users,
Can anyone explain step by step how to load data from flat file into teradata using tteradataTPT component , i tried but i am uanble to do so..i referred to online docs but its not helpful also few forums 
Please help its v urgent

Thanks
Amit
Moderator

Re: convert unix timestamp to different time zone

Hi Amit,
We have replied your another topic in:https://www.talendforge.org/forum/viewtopic.php?id=47689. Could you please take a look at it?

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.