Subtracting hours from a date time and converting to date time.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I'm having trouble with my date time subtracting. I first imported by data and the DATETIME_D it is in the initial format of 10/16/2022 23:00 (I believe this would be M/d/yyyy HH:mm), but there are no leading zeroes in everything.
To subtract 1 hour, I used this formula: datetimeadd([DATETIME_D],-1,"hours"), and I get errors like this : Formula (28) DATETIMEADD: "10/17/2022 8:00" is not a valid DateTime
Am I missing something?
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @IMTran
When you used the DateTime tool, you correctly transformed the DATETIME_D string to datetime, and the date is now inside of the Start column. So you need to apply the datetimeadd formula using the Start column as reference:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much for the help! This was a big oversight. Thank you for taking the time to help out. Hope you have a good day.
