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: 
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 (3)
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.