Search notes:

Stellarium API: core.getDate

core.getDate(spec) returns the current simulation time in ISO 8601 format (for example 2020-09-24T09:00:23).
The optional parameter spec is either
Unfortunately, it is not possible to create a JavaScript Date object from the returned string. The following snippet:
dtStr = core.getDate();
core.debug('dtStr = ' + dtStr);
dt    = new Date(dtStr);
core.debug(dt.toString());
prints
dtStr = 2020-09-24T09:07:25
Invalid Date

See also

Stellarium Script API

Index