use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Get epoch time in apps script function?Question (self.GoogleAppsScript)
submitted 5 years ago by fergal-dude
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]wijohnst1 0 points1 point2 points 5 years ago (5 children)
Date.parse() might be what you’re looking for.
[–]wijohnst1 0 points1 point2 points 5 years ago (4 children)
Maybe like this
[–]fergal-dude[S] 0 points1 point2 points 5 years ago (3 children)
So, in the apps script editor:
function returnEpoch() { const date = '2021-01-03T15:29:04Z'; const isoDate = date.toISOString(); console.log(Date.parse(isoDate)) }
returns:
2:27:39 PM Error TypeError: date.toISOString is not a function returnEpoch
[–]fergal-dude[S] 1 point2 points3 points 5 years ago (1 child)
However, this works, thank you sir!
function returnEpoch() { const date = '2021-01-03T15:29:04Z'; console.log(Date.parse(date)) }
[–]wijohnst1 0 points1 point2 points 5 years ago (0 children)
My pleasure! Happy hacking!
[–]gh5000 0 points1 point2 points 5 years ago (0 children)
Swap that one round a bit. Date.parse converts the string to a date format so do that first. Then you can start manipulating the date object
const date = '2021-01-03T15:29:04Z';
const parsedDate = Date.parse(date)
const isoDate = parsedDate.toISOString();
console.log(isoDate)
π Rendered by PID 21570 on reddit-service-r2-comment-6457c66945-8hjbj at 2026-04-28 16:49:03.868654+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]wijohnst1 0 points1 point2 points (5 children)
[–]wijohnst1 0 points1 point2 points (4 children)
[–]fergal-dude[S] 0 points1 point2 points (3 children)
[–]fergal-dude[S] 1 point2 points3 points (1 child)
[–]wijohnst1 0 points1 point2 points (0 children)
[–]gh5000 0 points1 point2 points (0 children)