Discuss Scratch

voidedminh
Scratcher
69 posts

Unix time?

Does anyone know how to convert from the output given by this block:
(days since 2000)
to Unix time?

Generation 379: The first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment. (I did not start this.)
forever
delete kumquats :: custom
end
NOW I can take care of these kumquats.
What do you mean evil mangoes-
Sadly, my signature has been eaten by an evil mango.
Sheep_maker
Scratcher
1000+ posts

Unix time?

(((days since 2000) * (86400000)) + (946684800000))
86 400 000 is the number of milliseconds in a day, and 946 684 800 000 is the Unix timestamp of January 1st, 2020 0:00 UTC from
Date.UTC(2000, 0, 1)

Last edited by Sheep_maker (April 7, 2020 05:21:38)


- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
voidedminh
Scratcher
69 posts

Unix time?

Sheep_maker wrote:

(((days since 2000) * (86400000)) + (946684800000))
86 400 000 is the number of milliseconds in a day, and 946 684 800 000 is the Unix timestamp of January 1st, 2020 0:00 UTC from
Date.UTC(2000, 0, 1)
I think you meant 1970. Unix time starts at January 1st, 1970.

Generation 379: The first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment. (I did not start this.)
forever
delete kumquats :: custom
end
NOW I can take care of these kumquats.
What do you mean evil mangoes-
Sadly, my signature has been eaten by an evil mango.
Sheep_maker
Scratcher
1000+ posts

Unix time?

voidedminh wrote:

Sheep_maker wrote:

(((days since 2000) * (86400000)) + (946684800000))
86 400 000 is the number of milliseconds in a day, and 946 684 800 000 is the Unix timestamp of January 1st, 2020 0:00 UTC from
Date.UTC(2000, 0, 1)
I think you meant 1970. Unix time starts at January 1st, 1970.
Sorry, I wasn't very clear. By “Unix timestamp,” I meant the number of milliseconds January 1st, 2020 was since the Unix epoch (January 1st, 1970)

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
__init__
Scratcher
1000+ posts

Unix time?

Sheep_maker wrote:

(((days since 2000) * (86400000)) + (946684800000))
86 400 000 is the number of milliseconds in a day, and 946 684 800 000 is the Unix timestamp of January 1st, 2020 0:00 UTC from
Date.UTC(2000, 0, 1)
isn't unix time usually in seconds?

(((days since 2000) * (86400)) + (946684800))

Last edited by __init__ (April 15, 2020 00:45:30)


thisandagain pls explain

Powered by DjangoBB

Standard | Mobile