Page 1 of 1

[Solved] Date/time not progressing?

Posted: Thu May 09, 2019 7:39 am
by nanashine
I have this code:

Code: Select all

init:
    $ import time

    $ year, month, day, hour, minute, second, dow, doy, dst = time.localtime()
    # dow = day of the week (Monday is 0 and Sunday is 6), doy = day of the year, dst = daylight saving time.    
    
    $ downames = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
    $ todays =  downames[(dow%7)]
    $ monthnames = ["December", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November" ]
    $ months =  monthnames[(month%12)]
And:

Code: Select all

screen timedaymonth:
    text "{size=28}[month]/[day]{/size}" xpos 635 ypos 0 
It was working normally before, but now time/date is not progressing at all. The weird thing is that I really didn't change anything in this code.

A lot of things on my game are based on the weekday, date, hour, etc and it doesn't "refresh"/progress unless you restart your phone.

Does anyone know what can be causing it?

Thanks.

Re: Date/time not progressing?

Posted: Thu May 09, 2019 7:56 am
by Saa
If you didn't change anything in this code, it's possible some other part of your code is affecting it.

Re: Date/time not progressing?

Posted: Fri May 10, 2019 11:22 pm
by nanashine
Instead of using "import time" I'm using "import datetime", and now it's working properly hah
Thanks :)