Bug - Not A Bug today_to_string() returns game date, not system date

Theraze

Active member
So, today_to_string should return GMT-0700 rather than GMT-0330 to actually be useful for players calculating which buff they should be getting, or is the current behaviour actually useful for... something? Besides naming session files with the "most of the gameday happens in this Arizona day" sense.
 

fronobulax

Developer
Staff member
So, today_to_string should return GMT-0700 rather than GMT-0330 to actually be useful for players calculating which buff they should be getting, or is the current behaviour actually useful for... something? Besides naming session files with the "most of the gameday happens in this Arizona day" sense.

If you are not concerned with when rollover is, "expressed" in your current timezone then you probably should be using now_to_string and siblings rather than today_to_string. I suspect you want the current behavior of today, rather than now, if you are deciding whether to cast Gar-ish.
 

Theraze

Active member
That's why I asked about GMT-0700. It's not my timezone, it's MST, aka Arizona time, aka KoL time. It's the timezone you need to know if Gar-ish will be Monday or not, rather than the current GMT-0330 that tells you... well, it tells you what your session file will be named. That's about it in terms of usefulness.

It's been confirmed that KoL cares about Arizona time rather than rollover. If you hit the lasagna late Sunday night, you can get your bonus for 'Monday'. If you hit it too early on Monday, you can lose your bonus for 'Tuesday'.

Unless that's changed.

Edit: Here's the bug report from 4 years ago where mafia used to use GMT-0330 and that was changed to GMT-0700 for Tuesday's ruby and lasagna. It was changed to use the proper GMT-0700 which fixed mafia's understanding of those items. We do still need to have the GMT-0330 for saving session files, as I noted, but I don't think it's really useful for anything else.
 
Last edited:

xKiv

Active member
but I don't think it's really useful for anything else.

Well, if you don't yet need it for anything, and don't think about anything you don't need ...

Now, technically, you can already check "numeric_modifier($item[tuesday ruby], "muscle percent") > 0" to see if gar-ish is useless right now.
(Modifiers has an override for TUESDAYS_RUBY that does Calendar.getInstance( TimeZone.getTimeZone( "GMT-0700" ) ).get( Calendar.DAY_OF_WEEK ) ) to decide .. and as far as I can tell, the result won't get cached anywhere - in other words, mafia won't think it's still sunday's effects at R+10 just because you logged in right after rollover)

You should *probably* also check "gametime_to_int() < 73800 - some_safety_buffer" to see if you still have at least some_safety_buffer seconds until kol switches to next day's effects.


BUT, I would propose an extension to now_to_string, so that It would be possible to do
Code:
print(now_to_string("yyyy.MM.dd G 'at' HH:mm:ss z", "GMT-0700"); // time in any timezone I choose
print(now_to_string("EEE", "GMT-0700"); // "Mon" when gar-ish is useless
print(now_to_string("EEE", "GMT-0655"); // this will become "Mon" 5 minutes earlier - use this to predict that garish might become useless while running the rest of your script
 

Theraze

Active member
as I said, the 'What day is it in Newfoundland' today_to_string function is only useful for knowing what your session file will be named, while 'What day is it in Arizona, which affects modifiers and actual things' does not exist unless you manually force it using now_to_string.

The only real thing using today_to_string for, that bounds on useful, is making manual _preference overrides when you want a history. It's not useful for anything else. If you're scripting something and you want it to work based on, well, anything actually useful, please don't trust it.
 
Top