should be gmtime, the function calls are inverted