The datetime comparisons are done as a string operation so to get it to work correctly you need to specify the datetimes in the format:
yyyy-MM-ddTHH:mm:ss (where the T is literal and stands for time).