Date and Time API?
Posted: Thu Apr 11, 2024 9:40 pm
I was thinking of putting in a date stamp for people getting high scores in a game, but noticed that there's no way of finding it out. CP/M 3 has date and time, but we're using 2.2 which doesn't. Also nothing in NABU-LIB. Was there something in the original NABU OS that did it? Or should it be done as a RetroNet command to the adapter to get the time stamp?
If so, please return something with 4+ digit year, month, day, hour, minute, second and time zone (taken from the computer hosting the adapter). Could be just a string. On Linux the date can take a format string and spit out everything needed. Assume the NABU side will handle localisation of month and day names. Include day of week to avoid some tricky computations. Have both the numeric time zone (so we can calculate UTC time) and time zone name (can't figure it out otherwise and need it for showing the user):
date "+%F %T %z %Z %u"
2024-04-14 19:04:01 -0400 EDT 7
And hey, then someone could write a NABU clock display, one which plays music on the hour
- Alex
If so, please return something with 4+ digit year, month, day, hour, minute, second and time zone (taken from the computer hosting the adapter). Could be just a string. On Linux the date can take a format string and spit out everything needed. Assume the NABU side will handle localisation of month and day names. Include day of week to avoid some tricky computations. Have both the numeric time zone (so we can calculate UTC time) and time zone name (can't figure it out otherwise and need it for showing the user):
date "+%F %T %z %Z %u"
2024-04-14 19:04:01 -0400 EDT 7
And hey, then someone could write a NABU clock display, one which plays music on the hour

- Alex