API: I don't seem to be able to store dates before 1970?
I don't seem to be able to upload files with dates before 1970. Here is an example transaction I made with rclone.
This is not entirely surprising since 1970-01-01 is the unix epoch and dates before that will be negative.
However dates before 1970 are supported in Google drive (for instance).
I searched the API docs and I couldn't find this limitation documented - apologies in advance if I missed the documentation.
2018/05/08 13:33:53 DEBUG : HTTP REQUEST (req 0xc42033a200) 2018/05/08 13:33:53 DEBUG : POST /api/2.0/files/content HTTP/1.1 Host: upload.box.com User-Agent: rclone/v1.41-032-g15256f3d-copy-file Transfer-Encoding: chunked Authorization: XXXX Content-Type: multipart/form-data; boundary=a37d853162f89f544a8fc168f24954a9072a82ffd9fd837d77098b4339a1 Accept-Encoding: gzip 207 --a37d853162f89f544a8fc168f24954a9072a82ffd9fd837d77098b4339a1 Content-Disposition: form-data; name="attributes" {"name":"hello.txt","parent":{"id":"***number removed for privacy***05"},"content_created_at":"1944-01-01T01:01:00+01:00","content_modified_at":"1944-01-01T01:01:00+01:00"} --a37d853162f89f544a8fc168f24954a9072a82ffd9fd837d77098b4339a1 Content-Disposition: form-data; name="contents"; filename="hello.txt" Content-Type: application/octet-stream hello --a37d853162f89f544a8fc168f24954a9072a82ffd9fd837d77098b4339a1-- 0
Response
2018/05/08 13:33:53 DEBUG : HTTP RESPONSE (req 0xc42033a200) 2018/05/08 13:33:53 DEBUG : HTTP/1.1 400 Bad Request Content-Length: 470 Age: 0 Cache-Control: no-cache, no-store Connection: keep-alive Content-Type: application/json Date: Tue, 08 May 2018 12:33:53 GMT Strict-Transport-Security: max-age=31536000 Vary: Accept-Encoding {"type":"error","status":400,"code":"bad_request","context_info":{"errors":[{"reason":"invalid_parameter","name":"content_created_at","message":"Invalid value '-***number removed for privacy***'. Value must be greater than or equal to 0"},{"reason":"invalid_parameter","name":"content_updated_at","message":"Invalid value '-***number removed for privacy***'. Value must be greater than or equal to 0"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Bad Request","request_id":"mmgizkfr47knmudw"}
-
Replying to my own message...
I've been pointed at this part of the docs:
> Box supports the subset of dates after the start of the Unix epoch: 1970-01-01T00:00:00+00:00 (00:00:00 UTC on January 1, 1970).
So it looks like box does not support dates prior to 1970...
Please sign in to leave a comment.
Comments
1 comment