I have this data.
11/17/2021 6:00 AM
I want to truncate the time 6:00 AM from the date. How will I do it in Coda ?
I have this data.
11/17/2021 6:00 AM
I want to truncate the time 6:00 AM from the date. How will I do it in Coda ?
the date and time is stored as a floating point number.
the integer part is the date.
the decimal fraction part is the time.
so round or truncate to an integer will leave the date without the time
As @Agile_Dynamics said, Dates, Times and Datetimes are stored as numbers within Coda and depending on your use case scenario, where your datetime is currently stored and what is the finality of the extraction there might be different ways to do this …
The formula ToDate() could potentially help you here …
Here’s a very quick sample using ToDate()
in very few somewhat different ways .
The best way is to either use
ToDate()
, orDateTimeTruncate("day")
The first one does what you need: strips the time and converts to a date. There’s a sister function ToTime()
that strips the date and leaves the time.
The second one strips everything to the specified accuracy. It could be “year”, “month”, “week” etc as well as “minute”, “hour”, not just a day.
P.S. I see as I briefly left AFK, @Pch already answered this I’ll leave my reply for the DateTimeTruncate()
option though. You may find it useful to e.g. quickly convert a date to the Fiscal Month in your budget doc or whatnot
Ah! I always forget about that one … My mental notes need some updates …
Thanks for the reminder @Paul_Danyliuk !
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.