Subj : Latest message timestamps To : Nightfox From : Digital Man Date : Mon Dec 07 2009 09:57 pm Re: Latest message timestamps By: Nightfox to All on Mon Dec 07 2009 04:29 pm > 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? Use the "when_imported_time" of the last message in the sub-board. That should always be the newest date/time. > 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? 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. The "when_written_time" is stored in UTC, but represents the local time in the time zone where the message was written (not necessarily the local time zone). digital man Snapple "Real Fact" #180: The first VCR was made in 1956 and was the size of a piano. .