# Celestia/Celx Scripting/CELX Lua Methods/CEL command time
### time

time { jd <juliandatenumber> }
-- OR --
time { utc <string> }
Sets the Date and Time using a Julian Date (a decimal number) or a UTC time string, in the format YYYY-MM-DDTHH:MM:SS.SSSSS.
Arguments:

#### jd <juliandatenumber>

    A valid Julian date. No default.
-- OR --
Arguments:

#### utc <string>

    A valid date in UTC format: YYYY-MM-DDTHH:MM:SS.SSSSS. No default.
Note: To obtain a Julian Date from a normal calendar date, try the U.S. Navy Calendar Date/Time to Julian Date/Time converter, located at: Julian Date Converter.
Note: Within Celestia it is also possible to obtain a Julian Date from a normal calendar date. Select the "Time" option in the menu bar. Next select the option "Set Time …" after which a "Set Simulation Time" window will be displayed. This window contains both Time formats and can be used to convert Julian Date/Time to UTC Date/Time and vice versa.
CELX equivalents:
Based on the celestia:settime method and some date/time conversion methods.
Starting with version 1.5.0, although Celestia still displays UTC on the screen, it uses the TDB time scale internally for everything else, so for CELX scripting !!!
* For these newer Celestia versions, using the UTC Julian date (as a result of the celestia:tojulianday method) in the celestia:settime method, will cause the WRONG setting of the simutation time. To set the simulation time, using Julian date for these newer Celestia versions, the 1.5.0 celestia:utctotdb method should be used instead.
* For these newer Celestia versions, using the celestia:gettime method to obtain a Julian date, and convert that to a Calendar date/time with this celestia:fromjulianday method, will cause to obtain the WRONG Calendar date/time. To obtain the right Calendar date/time, using the Julian date from the celestia:gettime method, for these newer Celestia versions, the 1.5.0 celestia:tdbtoutc method should be used instead.
* For more information on TDB, UTC, and how time is used in Celestia, see Time Scales.
To convert between Calendar date and Julian date, UTC and TDB, the following Celestia methods can be used:
* Celestia version 1.4.1 and older. Convert a UTC calendar date to a UTC Julian date and set simulation date/time. If not specified:
** <monthnumber> and <daynumber> default to one
** <hournumber>, <minutenumber> and <secondnumber> default to zero.
* Celestia version 1.4.1 and older. Get simulation date/time and convert a UTC Julian date to a UTC calendar date. The returned table "utctable" contains the keys:
** utctable.year = <yearnumber>
** utctable.month = <monthnumber>
** utctable.day = <daynumber>
** utctable.hour = <hournumber>
** utctable.minute = <minutenumber>
** utctable.seconds = <secondnumber>
* Celestia version 1.5.0 and newer. Convert a UTC calendar date to a TDB Julian date and set simulation date/time.If not specified:
** <monthnumber> and <daynumber> default to one
** <hournumber>, <minutenumber> and <secondnumber> default to zero.
* Celestia version 1.5.0 and newer. Get simulation date/time and convert a TDB Julian date to a UTC calendar date. The returned table "utctable" contains the keys:
** utctable.year = <yearnumber>
** utctable.month = <monthnumber>
** utctable.day = <daynumber>
** utctable.hour = <hournumber>
** utctable.minute = <minutenumber>
** utctable.seconds = <secondnumber>
Example: Examples of how to set the date and time to August 11, 2003 at 9:29:24 UTC.
CEL:
CELX Celestia version 1.4.1 and older:
CELX Celestia version 1.5.0 and newer:
Back to CEL command index