Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How do you convert scratch’s time thing in the api to real time?
- CST1229
- Scratcher
1000+ posts
How do you convert scratch’s time thing in the api to real time?
Assuming you're using JavaScript, you can get the date in UTC easily:
You can also get the time:
const date = "2007-03-05T10:47:41.000Z".split("T")[0]; // 2007-03-05
const time = "2007-03-05T10:47:41.000Z".split("T")[1].replace(".000Z", ""); // 10:47:41
Last edited by CST1229 (Sept. 13, 2021 09:29:59)
This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023
RIP assets image hosting. 2013?-2023
- Discussion Forums
- » Advanced Topics
- » How do you convert scratch’s time thing in the api to real time?