Google task api due field

951 views Asked by At

I am using google task list api and getting list from server. I created three task with different due time and date. I am getting date for every task but getting same due time. Can you please elaborate why this is happening?

Output:

{
  "kind": "tasks#tasks",
  "etag": "*********",
  "items": [
    {
      "kind": "tasks#task",
      "id": "******",
      "etag": "******",
      "title": "Task 2",
      "updated": "2021-01-29T14:40:36.000Z",
      "selfLink": "******",
      "position": "00000000000000000001",
      "status": "needsAction",
      "due": "2021-01-30T00:00:00.000Z"
    },
    {
      "kind": "tasks#task",
      "id": "*********",
      "etag": "*******",
      "title": "Task 4",
      "updated": "2021-01-29T13:18:51.000Z",
      "selfLink": "*******",
      "position": "00000000000000000000",
      "status": "needsAction",
      "due": "2021-01-30T00:00:00.000Z"
    },
    {
      "kind": "tasks#task",
      "id": "***********",
      "etag": "*************",
      "title": "Task 1",
      "updated": "2021-01-29T13:08:39.000Z",
      "selfLink": "*******",
      "position": "00000000000000000002",
      "status": "needsAction",
      "due": "2021-01-29T00:00:00.000Z"
    }
  ]
}
2

There are 2 answers

0
Ron M On

Based on the Resource:tasks,

Field: due

  • Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It isn't possible to read or write the time that a task is due via the API.
0
Ankit Punia On

Google api can only read date not time for due field. This line is from their official documentation Tasks API . tasks

Blockquote "due": "A String", # Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It isn't possible to read or write the time that a task is due via the API.