Create a new Timestamp object for a specific moment in Combine Galactic Time
Moment in CGT (year, day, and optionally hour, minute, second)
Get the day component
Day of the year (1-365)
Get the hour component
Hour of the day (0-23)
Get the minute component
Minute of the hour (0-59)
Get the second component
Second of the minute (0-59)
Get the year component
Year in CGT
Convert the CGT timestamp into a Date object
JavaScript Date object
Convert the CGT timestamp to a string
You can either pass in a preset name, or a custom format string.
Preset formats:
'full': Year 25 Day 60, 6:03:12'minute': Year 25 Day 60, 6:03'day': Year 25 Day 60'shortFull': Y25 D60, 6:03:12'shortMinute': Y25 D60, 6:03'shortDay': Y26 D60Custom format tags:
{y}: year{d}: day{h}: hour{m}: minute{s}: second{hh} = 08){hms}: shorthand for {hh}:{mm}:{ss}Preset format name or custom format string
Formatted timestamp string
Convert the CGT timestamp into a unix timestamp
Output unit (seconds or milliseconds)
Unix timestamp
StaticfromConvert a Date object into Combine Galactic Time
JavaScript Date object
Timestamp instance representing the CGT moment
StaticfromConvert a unix timestamp to Combine Galactic Time
Unix timestamp (seconds or milliseconds, auto-detected)
Timestamp instance representing the CGT moment
StaticnowGet the current Combine Galactic Time
Timestamp instance representing the current CGT moment
Utility class for working with Star Wars Combine timestamps. Represents Combine Galactic Time and can convert unix timestamps and Date objects to/from CGT.