Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
alexandermllr
Creator
Creator

Change time format - add UTC summer/winter hours

Hello,

I need add the hours to a time format when the time is the summertime or wintertime.
I have this:

Timestamp
04.05.2020 05:30:00
30.11.2020 20:15:00

 

I need to get this format:

Time
05:30:00+01:00
20:15:00+02:00

 

The timezone is always berlin.


Thanks for your help!

Labels (3)
1 Reply
QFabian
Specialist III
Specialist III

Hi @alexandermllr , here you have an example, i assume that the date is not valid so i had to convert it.

And if you have valid timestamp values, yuo just have to ask for the month, you know hich are the months for differents timezones. I wrote this as example Hour & ' ' & if(month(Date2)<5, '+1', '+2') as Hour;

 

Data:
LOAD * INLINE [
Timestamp
04.05.2020 05:30:00
30.11.2020 20:15:00

];

Load
Timestamp,
Date2 as Date,
Hour & ' ' & if(month(Date2)<5, '+1', '+2') as Hour;

Load
*,
makedate(subfield(Date, '.', 3),subfield(Date, '.', 2),subfield(Date, '.', 1)) as Date2;
Load
Timestamp,
subfield(Timestamp, ' ', 1) as Date,
subfield(Timestamp, ' ', 2) as Hour
Resident Data;

drop table Data;

exit script;

QFabian