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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jananireddy1
Contributor III
Contributor III

Timestamp function adding a extra minute

Hi Everyone, 

I am having trouble with the timestamp function. I want to be able to get this as my end result '2019-01-01 00:00:00' from the variable. Which is basically 2 years from current year. 

This is the code in my data load editor

SET TimeFormat='hh:mm:ss TT';
SET DateFormat='MM/DD/YYYY';
SET TimestampFormat='MM/DD/YYYY hh:mm:ss[.fff] TT';

Let vTimePeriod = Timestamp(YearStart(Today(), -2), 'YYYY-MM-DD HH:MM:SS');
//Let vTimePeriod = '2019-01-01 00:00:00';

 

The variable instead gives me '2019-01-01 00:01:00'. Not sure what could be done to fix this, looking for help. 

 

Thankyou

JR
Labels (2)
1 Solution

Accepted Solutions
Or
MVP
MVP

Your format should be lowercase hh:mm:ss, rather than uppercase (same as it appears in the SET statement, in fact). MM is month, not minute, so that's throwing your format off.

View solution in original post

1 Reply
Or
MVP
MVP

Your format should be lowercase hh:mm:ss, rather than uppercase (same as it appears in the SET statement, in fact). MM is month, not minute, so that's throwing your format off.