Inside of the process function:
_processTime(raw_ticks, time_format)
// (...)
var/time_remaining = ticks_after_starting_time + (time_zone * hourTicks)
// This is new and allows us to have an accurate remaining time.
var/time_remainingAc = (world.timeofday - startingTimeOffset()) + (time_zone * hourTicks)
That was the first change, adding in the time_remainingAc variable. Here was the second change.
var/daysIntoYear = round(time_remaining / day_ticks) + 1
var/daysModulo = time_remainingAc % day_ticks
var/hours = round(daysModulo / hourTicks)
var/hoursModulo = daysModulo % hourTicks
var/minutes = round(hoursModulo / minuteTicks)
var/minutesModulo = hoursModulo % minuteTicks
var/seconds = round(minutesModulo / secondTicks)
In here you can see that the daysModulo variable is now using that new variable I created to display the accurate hour/minutes/seconds.
So far all of this seems to work fine for me in my implementation and I want to confirm if this is correct or if anyone can find something faulty in my code. Thanks.
var/BaseCamp/Calendar/game_calendar = new()
client
New()
DisplayTime()
..()
proc/DisplayTime()
spawn(10)
world << "The time is [game_calendar.CurrentTime()]."
DisplayTime()
Yeah we didn't have world.timeofday back when this library was created (six years ago -- sheesh).
My concern about this approach is that ticks_after_starting_time could be larger than a day's worth of ticks, which would presumably have an undesirable effect. In your case, if this works for you, I'd say go for it. I won't be able to update the library until I have a chance to wrap my head around this stuff.
Also, unfortunately when I wrote this I wasn't taking a test-driven development approach yet, so it's harder for me to update. I oughta slap that guy who was me.
Meantime, unless this library is getting a lot of use, it's probably not worth it right now for me to put in the time. However, if people are using it, please let me know!