Time Commands¶
The time command group provides: - Conversion between time formats (MJD, JD, ISO-8601, GPS) - Conversion between time systems (UTC, TAI, GPS, UT1, TT) - Time arithmetic (adding/subtracting durations) - Time range generation
Commands¶
convert¶
Convert between time formats and time systems.
Syntax:
Arguments: - EPOCH - Time value to convert - INPUT_FORMAT - Format of input: mjd, jd, string, gps_date, gps_nanoseconds - OUTPUT_FORMAT - Desired output format (same options as input)
Options: - --input-time-system [UTC|GPS|TAI|UT1|TT] - Time system of input - --output-time-system [UTC|GPS|TAI|UT1|TT] - Time system of output
Examples:
Convert ISO-8601 string to Modified Julian Date:
Convert MJD to Julian Date:
Convert between time systems (UTC to TAI):
Convert GPS time to UTC:
add¶
Add a time offset to an epoch.
Syntax:
Arguments: - EPOCH - Starting epoch (ISO-8601 string, MJD, or JD) - SECONDS - Number of seconds to add (can be negative)
Options: - --output-format [mjd|jd|string|gps_date|gps_nanoseconds] - Output format (default: string) - --output-time-system [UTC|GPS|TAI|UT1|TT] - Output time system (default: UTC)
Examples:
Add 1 hour (3600 seconds):
Add 1 day (86400 seconds):
Subtract 30 minutes (negative seconds):
Output as MJD:
time-system-offset¶
Calculate the offset between two time systems at a given epoch.
Syntax:
Arguments: - EPOCH - Epoch to calculate offset at (ISO-8601 string) - SOURCE - Source time system: UTC, GPS, TAI, UT1, TT - TARGET - Target time system (same options)
Examples:
UTC to TAI offset:
GPS to UTC offset:
TAI to TT offset:
range¶
Generate a sequence of epochs over a time range.
Syntax:
Arguments: - EPOCH_START - Start of time range (ISO-8601 string) - EPOCH_END - End of time range (ISO-8601 string) - STEP - Step size in seconds
Examples:
Generate epochs every 30 minutes for 1 hour:
Generate epochs every 6 hours for 1 day:
Generate epochs every minute for 5 minutes:
Time Systems¶
UTC (Coordinated Universal Time)¶
- Civil time standard
- Includes leap seconds
- Most common for human-readable timestamps
TAI (International Atomic Time)¶
- Continuous atomic time scale
- No leap seconds
- Ahead of UTC by IERS-defined leap seconds (37s as of 2024)
GPS (Global Positioning System Time)¶
- Used by GPS satellites
- Started at 1980-01-06 00:00:00 UTC
- 19 seconds behind TAI (fixed offset)
UT1 (Universal Time 1)¶
- Based on Earth's rotation
- Irregular due to Earth rotation variations
- Requires Earth Orientation Parameters (EOP)
TT (Terrestrial Time)¶
- Ideal time for Earth-based observations
- Always 32.184 seconds ahead of TAI
Offset Relationships¶
Time Formats¶
ISO-8601 String (string)¶
Human-readable format with timezone:
Modified Julian Date (mjd)¶
Days since 1858-11-17 00:00:00 UTC:
Julian Date (jd)¶
Days since -4712-01-01 12:00:00 UTC:
Relationship: JD = MJD + 2400000.5
GPS Date (gps_date)¶
GPS week number and seconds:
GPS Nanoseconds (gps_nanoseconds)¶
Nanoseconds since GPS epoch (1980-01-06 00:00:00 UTC):
See Also¶
- Earth Orientation Data - EOP and UT1
- Epoch API - Python Epoch class
- EOP CLI - Earth Orientation Parameters
- Transform CLI - Coordinate transformations (require epochs)