Change method of working with date and time when querying counters