View previous topic :: View next topic |
Author |
Message |
jsmith840101
Joined: 06 Apr 2021 Posts: 1
|
Library functions for ISO8601 |
Posted: Tue Apr 06, 2021 11:21 pm |
|
|
Hello,
I have been working on epoch for close to a decade but now have decided its time to move to ISO8601. Does CCS / anyone have standard libraries made for it?
Functions that I could use right away are:
epoch_to_iso8601( epoch )
iso8601_to_epoch( iso8601 )
is8601_days_difference( iso8601, iso8601 )
where iso8601 format is yyyymmdd |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19506
|
|
Posted: Wed Apr 07, 2021 1:54 am |
|
|
Seriously stick with epoch internally.
It is a doddle to just print from time_t to a ISO8601 formatted output, and
similarly dead easy to parse ISO8601 to time_t. Then you have the huge
advantage of only needing 4bytes to physically store a time, versus more
than a dozen to store an ISO8601 format.
That is what most systems do internally. On Windows there are a couple
of basic libraries that do these conversions, and most software sticks to the
Unix epoch internally. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Wed Apr 07, 2021 4:30 am |
|
|
curious was i..
went to Wiki....
from the description...
The standard does not assign any specific meaning to elements of the date/time to be represented; the meaning will depend on the context of its use.
This didn't really inspire any confidence in ISO or ' standards'......
At my age in life, I don't care or need to know to the submillisecond the 'time', just happy to get up with Mr. Sun every day.... |
|
|
|