Add support for specifying the format string for the openspace.time.SPICE() function

This commit is contained in:
Alexander Bock
2025-09-11 21:15:40 +02:00
parent 971350028c
commit 1ff0fee1e8
5 changed files with 46 additions and 5 deletions

View File

@@ -613,6 +613,9 @@ public:
std::string dateFromEphemerisTime(double ephemerisTime, const char* format);
void dateFromEphemerisTime(double ephemerisTime, char* outBuf, int bufferSize,
const std::string& format = "YYYY MON DDTHR:MN:SC.### ::RND") const;
/**
* Returns the \p position of a \p target body relative to an \p observer in a
* specific \p referenceFrame, optionally corrected for \p lightTime (planetary

View File

@@ -136,6 +136,13 @@ public:
*/
std::string_view UTC() const;
/**
* Returns the current time as a formatted date string. The date string can be
* formatted using the SPICE picture parameters as described in
* https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html
*/
std::string_view string(const std::string& format) const;
/**
* Returns the current time as a ISO 8601 formatted, i.e YYYY-MM-DDThh:mm:ssZ.
*