Welcome! Log In Create A New Profile


time question

Posted by scognito 
time question
December 19, 2008 01:35PM
I'm trying to change my game theme using the date and time functions, in particular it should change the default theme to a christmas one if the current date is >= 15th dicember or <= 15 january.
I don't have my wii until 2009 so I can't test on real hardware.
Problem is I sent the game to a guy who tested, and he told me that it doesn't change theme, but as I don't want to bug him with other versions with debug informations I'm asking if you please can test if this function work changing dates.

bool isChristmas(){

    time_t now;
    struct tm  *ts;
    now = time(NULL);
    ts = localtime(&now);
    if((ts->tm_mon == 11 && ts->tm_mday  >=15) || (ts->tm_mon == 0 && ts->tm_mday  <=15)){
      return true;

    return false;

Don't know if time functions are implemented in libogc and/or my code is bugged, but he tried changing wii system date to
jan 17th 2009 and he is says it doesn't change theme.
Can please someone test it on real hardware changing dates? Currently it should return true, changing date to jan 17th 2009 should return false.
Thanks in advance!
Re: time question
December 19, 2008 01:57PM
Works for me. Returns 1 on today's date and returns 0 on 19/01/2009.
Re: time question
December 19, 2008 02:03PM
Oh thank you, maybe the guy didn't tested correctly!
Sorry, only registered users may post in this forum.

Click here to login