{"action":"opened","issue":{"url":"https://api.github.com/repos/tarunc/intercom.io/issues/10","labels_url":"https://api.github.com/repos/tarunc/intercom.io/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/tarunc/intercom.io/issues/10/comments","events_url":"https://api.github.com/repos/tarunc/intercom.io/issues/10/events","html_url":"https://github.com/tarunc/intercom.io/issues/10","id":54001548,"number":10,"title":"Date handling","user":{"login":"nolanamy","id":1137310,"avatar_url":"https://avatars.githubusercontent.com/u/1137310?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanamy","html_url":"https://github.com/nolanamy","followers_url":"https://api.github.com/users/nolanamy/followers","following_url":"https://api.github.com/users/nolanamy/following{/other_user}","gists_url":"https://api.github.com/users/nolanamy/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanamy/subscriptions","organizations_url":"https://api.github.com/users/nolanamy/orgs","repos_url":"https://api.github.com/users/nolanamy/repos","events_url":"https://api.github.com/users/nolanamy/events{/privacy}","received_events_url":"https://api.github.com/users/nolanamy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-11T19:22:56Z","updated_at":"2015-01-11T19:22:56Z","closed_at":null,"body":"I can safely use `Date` objects for standard user attributes:\r\n\r\n```\r\nintercom.createUser({\r\n  ...,\r\n  last_request_at: session.used\r\n}, cb);\r\n```\r\n\r\nBut for custom data I have to convert to an integer timestamp in seconds:\r\n\r\n```\r\ncustomData['Last used app'] = Math.round(session.used.getTime()/1000);\r\n```\r\n\r\nUsing a `Date` in custom data gives a very old time in Intercom (perhaps Unix time 0), and using an integer timestamp in milliseconds gives a time far in the future.\r\n\r\nPerhaps intercom.io should check for `Date` objects in custom data and automatically convert them to Intercom-friendly timestamps."}}