Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
RVeitch_84
Creator
Creator

Convert Epoch to UTC and then to SE or NZ timezone in tMap

In an example I have an epoch of 1708444826969 that I need convert into a UTC date and then to NZ and SE formats.

 

And I have done this so far

Convert epoch to long.

Long.parseLong(row4.time) as Var.epoch  where row4.time is my epoch string

Convert that to UTC.

TalendDate.formatDateInUTC("yyyy-MM-dd HH:mm:ss",new java.util.Date(Var.epoch)) as Var.utc

which returns 2024-02-20 16:00:26 which seems correct.

 

Now I want to convert that UTC to NZ and SE date/times

 

I've tried this and its not working?

TalendDate.formatDateLocale("yyyy-MM-dd HH:mm:ss",TalendDate.parseDateInUTC("yyyy-MM-dd HH:mm:ss",Var.utc) ,"SE")

 

Any help would be appricated.

 

Bob 

 

 

 

Labels (3)
2 Replies
Shicong_Hong
Support
Support

Hi 

What is the output string you get? what are your expected output?

Regards

Shong

RVeitch_84
Creator
Creator
Author

This is what is returned from this, 

TalendDate.formatDateLocale("yyyy-MM-dd HH:mm:ss",TalendDate.parseDateInUTC("yyyy-MM-dd HH:mm:ss",Var.utc) ,"SE")

2024-02-20 10:00:26

 

Should be this for Sweden:

2024-02-20 17:00:26

 

And this for New Zealand:

2024-02-21 05:00:26

RVeitch_84_0-1708693696188.png