Add days to datetime and replace time with custom time
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
jwalantdvyas
5 - Atom
‎03-20-2022
04:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Labels:
- Labels:
- Alteryx Practice
2 REPLIES 2
17 - Castor
‎03-20-2022
07:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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")
21 - Polaris
‎03-20-2022
10:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@jwalantdvyas
Since " 2022-03-21 10:00" is not a standard Date Time format, I am afraid we need to some parsing first.
