Difference between revisions of "Time Epochs"

From truxwiki.com
Jump to navigation Jump to search
Line 5: Line 5:
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Name
 
! Epoch
 
! Epoch
! Type
+
! Clock Tick
 +
! Data Type
 +
! Digits
 +
! Sample
 +
! SQLite
 
|-
 
|-
 +
| Apple NSDate
 +
| <code>01 Jan 2001</code>
 +
| 1 Second
 +
| Integer
 +
| 10
 +
| style="text-align:left;" | 1634658701
 +
| <code>DATETIME([time] + 978307200, 'unixepoch')</code>
 +
|-
 +
| Apple NSDate
 +
| <code>01 Jan 2001</code>
 +
| 1 Nanosecond
 +
| Integer
 +
| 10
 +
| style="text-align:left;" | 1634658701
 +
| <code>DATETIME(([time] / 1000000000) + 978307200, 'unixepoch')</code>
 +
|-
 +
| [[#UUID|UUID Type 1]]
 
| <code>15 Oct 1582</code>
 
| <code>15 Oct 1582</code>
| [[#UUID|UUID Type 1]]
+
| 100 Nanosecond
 +
| [https://www.rfc-editor.org/rfc/rfc4122#section-4.1.4 Integer]
 +
|
 +
|-
 +
| [[#Windows_FILETIME|Windows FILETIME]]
 +
| <code>01 Jan 1601</code>
 +
| 100 Nanosecond
 +
| Integer
 +
| 14
 +
| 100
 +
| <code>DATETIME( ([time] / 10000000) - 11644473600, 'unixepoch')</code>
 
|-
 
|-
 +
| [[#Chrome|Chrome]]
 
| <code>01 Jan 1601</code>
 
| <code>01 Jan 1601</code>
| [[#Windows_FILETIME|Windows FILETIME]]<br />[[#Chrome|Chrome]]
+
| 1 Microsecond
 +
| Integer
 +
| 10
 +
|
 +
| <code>DATETIME( ([time] / 10000000) - 11644473600, 'unixepoch')</code>
 
|-
 
|-
 
| <code>30 Dec 1899</code>
 
| <code>30 Dec 1899</code>
 
| [[#Windows_COM|Windows COM]]
 
| [[#Windows_COM|Windows COM]]
 
|-
 
|-
 +
| Unix
 +
| <code>01 Jan 1970</code>
 +
| 1 Second
 +
| Integer
 +
| 10
 +
| style="text-align:left;" | 1634658701
 +
| <code>DATETIME([time], 'unixepoch')</code>
 +
|-
 +
| Unix
 +
| <code>01 Jan 1970</code>
 +
| 1 Millisecond
 +
| Integer
 +
| 13
 +
| style="text-align:left;" | 1634658701948
 +
| <code>DATETIME([time] / 1000, 'unixepoch')</code>
 +
|-
 +
| Unix
 +
| <code>01 Jan 1970</code>
 +
| 1 Microsecond
 +
| Integer
 +
| 16
 +
| style="text-align:left;" | 1634658701948449
 +
| <code>DATETIME([time] / 1000000, 'unixepoch')</code>
 +
|-
 +
| Unix
 
| <code>01 Jan 1970</code>
 
| <code>01 Jan 1970</code>
| [[#Unix_Time|Unix Time]]<br />[[#Firefox|Firefox]]
+
| 1 Nanosecond
 +
| Integer
 +
| 19
 +
| style="text-align:left;" | 1634658701948449001
 +
| <code>DATETIME([time] / 1000000000, 'unixepoch')</code>
 
|-
 
|-
 
| <code>01 Jan 2001</code>
 
| <code>01 Jan 2001</code>

Revision as of 06:14, 13 June 2026

Epochs

Here's some of the time formats that Truxton can handle. Wikipedia has a better list. The Truxton software uses FILETIME for all time calculations.

Name Epoch Clock Tick Data Type Digits Sample SQLite
Apple NSDate 01 Jan 2001 1 Second Integer 10 1634658701 DATETIME([time] + 978307200, 'unixepoch')
Apple NSDate 01 Jan 2001 1 Nanosecond Integer 10 1634658701 DATETIME(([time] / 1000000000) + 978307200, 'unixepoch')
UUID Type 1 15 Oct 1582 100 Nanosecond Integer
Windows FILETIME 01 Jan 1601 100 Nanosecond Integer 14 100 DATETIME( ([time] / 10000000) - 11644473600, 'unixepoch')
Chrome 01 Jan 1601 1 Microsecond Integer 10 DATETIME( ([time] / 10000000) - 11644473600, 'unixepoch')
30 Dec 1899 Windows COM
Unix 01 Jan 1970 1 Second Integer 10 1634658701 DATETIME([time], 'unixepoch')
Unix 01 Jan 1970 1 Millisecond Integer 13 1634658701948 DATETIME([time] / 1000, 'unixepoch')
Unix 01 Jan 1970 1 Microsecond Integer 16 1634658701948449 DATETIME([time] / 1000000, 'unixepoch')
Unix 01 Jan 1970 1 Nanosecond Integer 19 1634658701948449001 DATETIME([time] / 1000000000, 'unixepoch')
01 Jan 2001 Apple

Apple Cocoa Core

Cocoa Core (aka NSDate) is the number of seconds (32-bit value) since 01 Jan 2001. The 64-bit version is the number of nanoseconds since 01 Jan 2001.

Chrome

Chrome stores the time as a 64-bit integer representing the number of microseconds since 01 Jan 1601.

Firefox

Firefox (PRTime) stores the time as a 64-bit integer representing the number of microseconds since 01 Jan 1970.

Unix Time

This is a 32-bit integer holding the number of clock ticks since 01 Jan 1970. You will see this value in a variety of ticks.

Hints

The Unix epoch can be stored in several different clock ticks.

Digits Clock Tick Units Example SQLite
10 One Second 1634658701 DATETIME([time], 'unixepoch')
13 One Millisecond 1634658701948 DATETIME([time] / 1000, 'unixepoch')
16 One Microsecond 1634658701948449 DATETIME([time] / 1000000, 'unixepoch')
19 One Nanosecond 1634658701948449001 DATETIME([time] / 1000000000, 'unixepoch')

UUID

A 60-bit integer holding the number of 100-nanosecond clock ticks since 15 Oct 1582.

Windows COM

Windows COM stores date time in a double (floating point) number representing the number of days since 30 Dec 1899.

Windows FILETIME

A 64-bit integer containing the number of 100-nanosecond clock ticks since 01 Jan 1601.