Commit ID 54d88796c54e253974d5280831082ecf13cbdde7
|
|
Contributor: | Thorsten Glaser | Files Modified: | 1 |
| Date: | 15-July-2012 at 14:25 | Lines Added: | 0 | |
| Repository: | https://evolvis.org/anonscm/git/shellsnippets/shellsnippets.git master | Lines Removed: | 0 | |
| Commit Comment: | time manipulation functions in Pure mksh™ POSIX (i.e. no leap second support and Y2038 problem) available definitions: • tm_* constants (offset of "struct tm" members in indexed array) • mirtime_months, mirtime_wdays (mapping to strings in the "C" locale) available functions: • timet2mjd ${posix_timet_seconds} ⇒ ${mjd_day} ${mjd_sec} • mjd2timet ${mjd_day} ${mjd_sec} ⇒ ${posix_timet_seconds} • mjd_explode ${mjd_day} ${mjd_sec} ⇒ ${struct_tm[@]} • mjd_implode ${struct_tm[@]} ⇒ ${mjd_day} ${mjd_sec} The functions all currently share that they take and output an array (mirtime_mjd or struct tm) in split form, i.e. one function argument per struct member, and space-separated output. (This works with this data.) Not all members of struct tm are used: When emitting a struct tm (by mjd_explode), these are hardcoded: • tm_isdst = 0 • tm_gmtoff = 0 • tm_zone = "UTC" When parsing a struct tm (by mjd_implode), these are ignored: • tm_wday, tm_yday (only tm_mon+tm_mday are used) • tm_isdst (only tm_gmtoff is used as additional offset) • tm_zone (it's a descriptive string anyway) This matches behaviour of the mirtime functions in MirBSD libkern (kernel, bootloader, libc), except that no leap second information is available, and mksh_ari_t (32 bit) is used instead of time_t. |
|||
No code was detected in this commit.
| File | Language | Code Added | Code Removed | Comments Added | Comment Removed | Blanks Added | Blanks Removed | |
|---|---|---|---|---|---|---|---|---|
| mksh/timefns | No source code was detected in this file. | |||||||
Copyright
©
2013
Black Duck Software, Inc.
and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a
Creative Commons Attribution 3.0 Unported License
. Ohloh
®
and the Ohloh logo are trademarks of
Black Duck Software, Inc.
in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.