Hi all -
I've been updating the command shell on my BBS (written in JavaScript) so that in the message sub-board listings (i.e., when the user wants to jump
to a new sub-board), it will display the date & time of the newest message along with the sub-board name and number of messages for each sub-board. However, I've noticed something that may complicate that a bit - The last message posted in a sub-board might not necessarily be the newest message, according to its timestamp. In QWK-networked sub-boards, I'd guess that this may be due to a delayed posting or because of QWK accounts being in different time zones.
In my command shell, I could get the dates & times for all the messages in
a sub-board, sort them, and choose the latest date & time that way, but
that can be slow. Alternatively, I can simply get the date & time of the last message posted in the sub-board. Is there a better way to get the latest date & time of a message that is still fast?
As far as the message timestamps, is it true that all messages (even in QWK-networked sub-boards) have a timestamp in the local time zone of the originating BBS?
Use the "when_imported_time" of the last message in the sub-board. That s always be the newest date/time.
The times are stored in UTC. If you wish to know the time zone of when a message was written, check the "when_written_zone" header property value. "when_written_time" is stored in UTC, but represents the local time in th zone where the message was written (not necessarily the local time zone).
As far as the message timestamps, is it true that all messages (even in QWK-networked sub-boards) have a timestamp in the local time zone of the originating BBS?
Yeah, the date-time for networked messages will be in local time from whe they are posted, with no reliable internationalization. Your best bet is check the filesystem date/time for the board in question. You can then s show a "Last Update/Post: yyyy-MM-dd HH:mm" based on the FS's date time.
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 140:27:07 |
Calls: | 369 |
Files: | 2 |
Messages: | 38,441 |