Setting due date to 1970-01-01T00:00:00 clears the property

Update a task with the following due_at dates:

  • “1969-12-31T23:59:59+0000” => expected value is set
  • “1970-01-01T00:00:00+0000” => clears the due_at property
  • “1970-01-01T00:00:01+0000” => expected value is set

It appears you use the unix epoch start date to clear the due_at property, but this is unexpected given I can use a date from before the epoch start date and it’s correctly set (first bullet). In order to clear the value sending a request with “due_at:null” is sufficient.

Are you coming from the future and trying to set yourself up some tasks for then you travel back to the past? :mantelpiece_clock: :grimacing:

Yup. That is exactly what I’m trying to do :slight_smile: The problem is I receive unexpected result for one particular date. Any other date later than 100AD (sic!) works fine, based on our tests.

What makes “1970-01-01T00:00:00+0000” special? Is it a bug? Should I avoid setting due dates in the past? Maybe a 400 Bad Request would be better in this case, for date values that are not allowed.

It is Epoch time, kinda special date indeed Unix time - Wikipedia

Yes, I’m aware of that, but I still think it’s a bug, see my first comment. Using it to clear the due date is unexpected.

I could see a code where the date stored is the number of secondes from epoch and when it stores zero that clears the field ^^ nice bug =) not sure they will prioritize a fix though :sweat_smile:

Yup, I’m pretty sure this is the case. Fair enough with not fixing it any time soon, it’s a minor issue. Just wanted to confirm it’s a bug on the Asana side. Thanks!

1 Like