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: 
Anonymous
Not applicable

How can i change the date by changing the hour

Dear All,

I have this format 2014.07.31 23.00 which i would like to add 1 hour so it would change the date from 07.31 to 08.01 the rest of the hours will be shifted +1 i mean

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Here format is crucial, be sure about the format you have in starttime field and the one you are using in timestamp#() are similar. Even spaces in between matter. if there is a space in between date part and hour part try like:

Timestamp(Timestamp#(starttime,'YYYYMMDD hhmm')+(1/24))  as test1,

View solution in original post

9 Replies
Or
MVP
MVP

YourDateColumn + (1/24)

Should do the trick.

ashfaq_haseeb
Champion III
Champion III

Hi,

Try below.

Load Timestamp((Date + Timestamp(MakeTime(1,00))),'DD/MM/YYYY hh.mm.ss') as Date1;

load Date(date#(Date_Time,'YYYY.MM.DD h.mm'),'M/D/YYYY h:mm:ss[.fff] TT') as Date;

load * Inline

[

Date_Time

2014.07.31 23.00

]

Regards

ASHFAQ

Anonymous
Not applicable
Author

it's not working

someone told me about this function but it's not working anymore

=Timestamp(Timestamp#(FieldName,'YYYYMMDDHHmm') + MakeTime(1),'YYYYMMDDHHmm')


can you help ?

manideep78
Partner - Specialist
Partner - Specialist

Hi Tamer,

Try this, It should work.

=timestamp(Timestamp#('2014.07.31 23.00 ', 'YYYY.MM.DD hh.mm')+(1/24))


OR

If you want to specify the format use below


=timestamp(Timestamp#('2014.07.31 23.00 ', 'YYYY.MM.DD hh.mm')+(1/24),'YYYY.MM.DD hh.mm')

Regards

Manideep

ashfaq_haseeb
Champion III
Champion III

Hi,

Its working.

I have tried you can even try by copy my code to new qvw file and try to replicate the same.

Regards

ASHFAQ

Anonymous
Not applicable
Author

the below is what i write in the code but it returns nothing

Timestamp(Timestamp#(starttime,'YYYYMMDDhhmm')+(1/24))  as test1,

tresesco
MVP
MVP

Here format is crucial, be sure about the format you have in starttime field and the one you are using in timestamp#() are similar. Even spaces in between matter. if there is a space in between date part and hour part try like:

Timestamp(Timestamp#(starttime,'YYYYMMDD hhmm')+(1/24))  as test1,

Anonymous
Not applicable
Author

this is the time format i have

2014.08.06 20.00

Anonymous
Not applicable
Author

thanks a lot it's working