| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Time format https://mail.black-squirrel.com/viewtopic.php?f=52&t=31613 |
Page 1 of 1 |
| Author: | John Pritchett [ Sat May 28, 2011 6:39 pm ] |
| Post subject: | Time format |
I've noticed an odd format for times shown in TW. It uses the format HH:MM:SS AM/PM. Since it uses AM/PM, it's not military time, meaning HH should be from 1-12. However, TW displays midnight as 0 rather than 12. So what should be 12:05:15 AM is actually shown as 00:05:15 AM. My question is, should I fix this, or will it cause problems with scripts and helpers if I change it? I don't have to change it. It's just a bug I noticed. |
|
| Author: | Singularity [ Sat May 28, 2011 7:25 pm ] |
| Post subject: | Re: Time format |
Minor issue to fix if we need to. Either way is fine. |
|
| Author: | John Pritchett [ Sat May 28, 2011 7:29 pm ] |
| Post subject: | Re: Time format |
Cool. Done. I noticed it while coding some improvements to the announcement screen. It'll now jump to the starting point with a binary search rather than scan from start of file to specified date, so there shouldn't be any more long pauses or unnecessary disk access there. |
|
| Author: | Big D [ Sat May 28, 2011 7:45 pm ] |
| Post subject: | Re: Time format |
There aren't that many scripts that use the time format and most of the scripts that do use the time as a trigger are more than likely private scripts used by scripters. This would be a minor change to repair and will effect very few scripts. |
|
| Author: | Vid Kid [ Sat May 28, 2011 11:55 pm ] |
| Post subject: | Re: Time format |
Well for those that use it , it will be fun to work out the backward compatibility so that those scripts work on current public versions of TW as well as this up coming one. my 2ยข |
|
| Author: | John Pritchett [ Sun May 29, 2011 12:59 am ] |
| Post subject: | Re: Time format |
It's a very easy conversion. In any time display of HH:MM:SS AM, if HH is 12 in the new version, it should be 00 in the old one. So for example, 12:08:20 AM would convert to 00:08:20 AM to be compatible with the old version. But I'd be very surprised if any script cared about the hour field of a date. These show up in the log files and when you press T to see the time. |
|
| Author: | Singularity [ Sun May 29, 2011 2:26 am ] |
| Post subject: | Re: Time format |
Yea, it's a very easy conversion. If HH = 12 and AM/PM = AM, then set HH to 0 and convert like before. 10 second fix. I do use HH:MM:SS to create a timestamp I call the "Tradewars Epoch" ... the seconds since Jan 1st, 2002. I use that to track enemy movements thru grid (CIM scans), fighits, etc. Since most people tend to grid in areas that aren't their base, I use that to further refine grid targeting. I also use it on my red scripts to automatically clear busts in some cases. Will it be a problem tho? No. It's a very easy fix. |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|