Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
alexC
Contributor II
Contributor II

TimeStamp format

Hi,

I am loading a timestamp field in the format '2021-08-02 11:00:00+00' and I cannot convert it to DAY or MONTH since it is probably not recognized as timestamp.

In the load script I have this format: SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff] TT';

 

What can I do?

Labels (1)
3 Replies
Digvijay_Singh

Try something like this - 

Timestamp#(subfield('2021-08-02 11:00:00+00','+',1),'YYYY-MM-DD hh:mm:ss')

//You may need to use the actual field instead of the subfield I have used in the example.

'+00' indicates time zone I think, but not sure how do you want to utilize it, there is a function in qlik to convert time to local timing but I never used that - 

https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions/con...

 

alexC
Contributor II
Contributor II
Author

Thank you, actually it worked, but it is a temporary solution till I understand how to use it.

I think '+00' represents the summer/winter time adjustment and/or time zone.

By trimming (ignoring) it my data will deviate by 2-3 hours (in my particular case).

vinieme12
Champion III
Champion III

as below

 

Capture.PNG

temp:
load 
new_timestamp
,Day(new_timestamp) as day
,date(floor(new_timestamp)) as date
;
load timestamp#(replace(timstaaamp,' ','T'),'YYYY-MM-DDhh:mm±hh:mm')  as new_timestamp inline [
timstaaamp
2021-08-02 11:00:00+01:00
];

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.