mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add helper functions to format / parse timestamps
To save datetime-based filter constraints to git or XML, it is preferrable to use human-readable representations. Therefore, add helper functions to format / parse timestamp_t 64-bit values in the "YYYY-MM-DD hh:mm:ss" format. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f9721fce4b
commit
8f898477cb
2 changed files with 54 additions and 0 deletions
|
@ -14,6 +14,10 @@ extern void utc_mkdate(timestamp_t, struct tm *tm);
|
|||
extern int utc_year(timestamp_t timestamp);
|
||||
extern int utc_weekday(timestamp_t timestamp);
|
||||
|
||||
/* parse and format date times of the form YYYY-MM-DD hh:mm:ss */
|
||||
extern timestamp_t parse_datetime(const char *s); /* returns 0 on error */
|
||||
extern char *format_datetime(timestamp_t timestamp); /* ownership of string passed to caller */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue