This mistake is quite easy to make in JavaScript. Dates are internally milliseconds since epoch but if you construct a date by giving year, month, day, you get midnight in the local timezone which may well be on a different day from midnight in UTC, so if you send back a unix timestamp or (trying to be clever) use UTC functions to get a date from a Date object, you may likely get an off by one error.