how to find milliseconds from epoch 2000 mathmatically?

ncc1701d

Member
Joined
Aug 9, 2009
Messages
204
Reaction score
6
Points
18
Hello
I have a date 2004-01-03T:13:46:31:000z UT1 and then i have the unix epoch 1970-01-01T00:00:00:000z UT1 How do I find milliseconds between them mathmatically without using someones or some programming languages pre-written functions?
JD = 2453008.073970 for first date and unix epoch JD = 2440587.500000

the difference is JD = 12420.57397.. Now what? is this even the right way so far?
Anyone know? thank you.
 

Keithth G

New member
Joined
Nov 20, 2014
Messages
272
Reaction score
0
Points
0
What I think you are asking is: how many milliseconds are there between the two dates?

If so, converting to Julian Date is fine.

You have calculated the difference as 12420.57397 days. Now there are 86400 seconds in a day (24 x 60 x 60) so the difference is 1073137591.0 seconds. And since there are 1000 milliseconds in a second, that works out to 1073137591000 milliseconds.

Note that three zeros at the end of the figure. This is because recording julian dates with six decimal places isn't enough to record milliseconds. To get an accurate number of milliseconds, you need to record JDs with 9 decimal places. Your original dates (2004-01-03T:13:46:31:000z UT1 and 1970-01-01T00:00:00:000z UT1) record times with millisecond accuracy so you just need to adjust your JD calculation so that it gives you three more digits of accuracy.
 
Last edited:

ncc1701d

Member
Joined
Aug 9, 2009
Messages
204
Reaction score
6
Points
18
If i use windows calculator i get 1073137591.008 seconds so I would get 1073137591008 milliseconds.
is this answer more accurate?
Not trying to be overly picky. Iam just wondering if Iam supposed to keep the 008 in my final answer?
 

Keithth G

New member
Joined
Nov 20, 2014
Messages
272
Reaction score
0
Points
0
No, because with six decimal places the JDs don't carry information with millisecond accuracy. At best, you get 0.1 second accuracy with 6 decimal places in your JDs.

The millisecond precision of your 1073137591.008 is spurious.
 
Last edited:

ncc1701d

Member
Joined
Aug 9, 2009
Messages
204
Reaction score
6
Points
18
my understanding is I needed millieseconds between UT1 times
Then the leap seconds are calculated in later.
And to get leapseconds included you refer to a chart
ftp://maia.usno.navy.mil/ser7/tai-utc.dat and program it all in to put it overly simply.
It gets little messy.
 

ncc1701d

Member
Joined
Aug 9, 2009
Messages
204
Reaction score
6
Points
18
I just wanted to add clarification in case someone reads this thread..
In my original question I mentioned date
"2004-01-03T:13:46:31:000z UT1" ...but because its 000z it was actually a UTC.
So Keithth was helping find milliseconds between two UTC dates.
Since .000z was only a zeros it didnt change his help or anything.

The difference between UTC and UT1 is DUT1 and thats when you get into dealing with leap seconds subject.
 
Top