In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Add days to datetime and replace time with custom time

jwalantdvyas
5 - Atom

I want to add 2 days to my date and time field and replace time with custom value

 

if my

[datetime] = 2022-03-21 10:00

 

I want to add 2 days to it and change time to 13:00

[OutDateTime] = 2022-03-23 13:00

2 REPLIES 2
AkimasaKajitani
17 - Castor
17 - Castor

Hi @jwalantdvyas 

 

You can use DateTimeTrim expression to cutoff the hours and use the DateTimeAdd expression to add 61(24*2+13) hours.

 

DateTimeAdd(DateTimeTrim([datetime],"day"),61,"hour")

 

Qiu
21 - Polaris
21 - Polaris

@jwalantdvyas 
Since " 2022-03-21 10:00" is not a standard Date Time format, I am afraid we need to some parsing first.

0321-jwalantdvyas.PNG

Labels
Top Solution Authors