convertTime
Usage:
y = convertTime(to, from, time)
Purpose:
convertTime converts the input time from one timescale to another as specified by the user. The input and output times are in datenum format. Valid input and output timescales can be found by calling convertTime with no input arguments. Valid time scales are: 'GPS', 'UTC', 'TT', 'TDB', and 'TAI'.
Special handling for GPS times:
Note that GPS time inputs and outputs are based on the GPS epoch of Jan 6, 1980 and not the standard datenum epoch. Calling this fuction with GPS inputs or outputs will require a correction to be applied to any datenum-based times, as in:
for GPS time input that starts in datenum format:
nowdatenum = now;
nowgpsinput = nowdatenum - datenum('Jan 6 1980');
nowutcoutput = convertTime('UTC','GPS',nowgpsinput);
for GPS time output that needs to be converted to datenum format:
nowdatenum = now;
nowgpsoutput = convertTime('GPS','UTC',nowdatenum);
nowutcdatenum = nowgpsoutput + datenum('Jan 6 1980');
Note that datenum('Jan 6 1980') = 723186 (exact).
Inputs:
Variable
Size
Description
to
(1X1)
String specifying output timescale.
from
(1X1)
String specifying input timescale.
time
(1Xn)
Input time in datenum format.
Outputs:
Variable
Size
Description
y
(1XN)
Output time in datenum format.
[MatlabJatAdaptor] - Go back to the JAT Adaptors page
[ForDevelopers] - Go back to the main development page
WikiStart -- Return to Wiki Start page.