I’m trying to format a bunch of date ranges to be used in WORKDAY().
I created a script that collects these dates from a base and have them converted to iso-dates.
However all my dates has a trailing time stamp of T00:00:00.000Z.
Wondering if there is a quick way to omit of the time stamp so it’s only YYYY-MM-DD?
Solved
Take away time stamp from ISO date
Best answer by Bill_French
Well, there are as many ways to do this as there are to compute your personal tax liability, but… I’m lazy so when dealing with predictable strings - like an ISO date - I just do this:
Given this:
let isoDate = "2016-05-24T15:31:48.335Z";
I would simply:
let dateOnly = isoDate.split("T")[0];
Javascript experts would probably spit on my grave for suggesting this. But in a sanitized environment like Script Blocks, I’m not actually sure what level of date formatting support exists.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
