Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1289
I have encountered some incomprehensible time calculation code, so after a lot of asking around and a bit of googling and testing...
CODE
unsigned int calc_times(void)
{
time_t temp = time(NULL);
return (unsigned int)mktime(localtime(&temp));
}
My conclusion is that this function is a no-op. Doing 'localtime' breaks down the timestamp into components, and mktime puts them back together again. So, calc_times() gives the same result as time() itself.
I have tested this both in a DST environment and non-DST, and the value was always the same.
Am I missing something here? Zephyrus (the author) says that 'jAthena does this too'... but doesn't know why.
N> feedback.