When using the command `time query daytime` the returned value just keeps going up and never resets itself back to 0 even after tracking the day/night cycles for a game month. Only when a command 'time set day' is issued does it reset to 1000 and then starts rising again.
I tested this by setting up a command block clock which then triggers another command block with the time query command, and storing it to a scoreboard, and then checking the output of a scoreboard test. You can see about my setup from this question on the StackExchange: http://gaming.stackexchange.com/questions/181930/how-to-test-for-time-of-day-with-command-block-in-minecraft/181940#181940
I can provide a test world if necessary to show what I mean.