I will chime in and say it may depend on what version of gamemaker you are using whether or not the date and time functions will return usable numbers. In GM:Studio currently for example, in both the windows and html5 compile you end up with the date/time value being inprecise and rounded, making it unable to return the amount of seconds or even minutes passed between 2 date/time values. I have been trying to work around this for some time and even submitted bug reports but to no avail, as my game also relies on a mechanic that detects how much time passes between a save/load. If anyone else has more insight into these functions it would be useful for me as well.
I tested the date functions in GM:HTML5 by saving the datetime to an INI file and then reading back in and comparing with the current datetime. This seemed to work fine.
But I just tested the same thing with GM-Studio and it doesn't work at all. I thought this might be due to rounding errors when I wrote the datetimes out to a file, and this does happen (as seen below). However, Studio doesn't even seem to be able to calculate the time difference correctly internally anyway as I also tried calculating the difference without the read from file stage.
BTW, when I thought the problem was with rounding errors when writing to file I used 'ini_write_real' and 'file_text_write_real' here to check rounding differences between GM:HTML5 and Studio... there doesn't seem to be any consistency:
HTML5 INI: 41008.7481593634
HTML5 TXT: 41008.757810
Studio INI: 41008.718432
Studio TXT: 41008.7155
Assuming the HTML INI entry is correct, as it produced correct time differences when read in, this does appear to be a bug in Studio!
Edited by Centauri, 09 April 2012 - 05:31 PM.