{"action":"created","issue":{"url":"https://api.github.com/repos/mcollina/msgpack5/issues/19","labels_url":"https://api.github.com/repos/mcollina/msgpack5/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/mcollina/msgpack5/issues/19/comments","events_url":"https://api.github.com/repos/mcollina/msgpack5/issues/19/events","html_url":"https://github.com/mcollina/msgpack5/issues/19","id":62425431,"number":19,"title":"Can't encode/decode a Date object","user":{"login":"xsellier","id":6616005,"avatar_url":"https://avatars.githubusercontent.com/u/6616005?v=3","gravatar_id":"","url":"https://api.github.com/users/xsellier","html_url":"https://github.com/xsellier","followers_url":"https://api.github.com/users/xsellier/followers","following_url":"https://api.github.com/users/xsellier/following{/other_user}","gists_url":"https://api.github.com/users/xsellier/gists{/gist_id}","starred_url":"https://api.github.com/users/xsellier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xsellier/subscriptions","organizations_url":"https://api.github.com/users/xsellier/orgs","repos_url":"https://api.github.com/users/xsellier/repos","events_url":"https://api.github.com/users/xsellier/events{/privacy}","received_events_url":"https://api.github.com/users/xsellier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-17T15:18:19Z","updated_at":"2015-03-17T15:24:42Z","closed_at":null,"body":"Try this code:\r\n\r\n```javascript\r\nvar msgpack5  = require(\"msgpack5\")();\r\nvar date = new Date();\r\nconsole.log(date);\r\nvar result = msgpack5.decode(msgpack5.encode( {\"date\": date}));\r\nconsole.log(result);\r\n```\r\n\r\nOutput:\r\n\r\n      Tue Mar 17 2015 11:17:52 GMT-0400 (EDT)\r\n      { date: {} }"},"comment":{"url":"https://api.github.com/repos/mcollina/msgpack5/issues/comments/82410988","html_url":"https://github.com/mcollina/msgpack5/issues/19#issuecomment-82410988","issue_url":"https://api.github.com/repos/mcollina/msgpack5/issues/19","id":82410988,"user":{"login":"mcollina","id":52195,"avatar_url":"https://avatars.githubusercontent.com/u/52195?v=3","gravatar_id":"","url":"https://api.github.com/users/mcollina","html_url":"https://github.com/mcollina","followers_url":"https://api.github.com/users/mcollina/followers","following_url":"https://api.github.com/users/mcollina/following{/other_user}","gists_url":"https://api.github.com/users/mcollina/gists{/gist_id}","starred_url":"https://api.github.com/users/mcollina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcollina/subscriptions","organizations_url":"https://api.github.com/users/mcollina/orgs","repos_url":"https://api.github.com/users/mcollina/repos","events_url":"https://api.github.com/users/mcollina/events{/privacy}","received_events_url":"https://api.github.com/users/mcollina/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T15:24:42Z","updated_at":"2015-03-17T15:24:42Z","body":"Date is not included in the spec: https://github.com/msgpack/msgpack/blob/master/spec.md\r\n\r\nI think it would be great if you write a little module that register an extension for encoding a Date, given a `msgpack5` instance. If you are willing to write that module, I would definitely list in the README.\r\n\r\nYou should use https://github.com/mcollina/msgpack5#registerencodercheckobj-encodeobj and https://github.com/mcollina/msgpack5#registerdecodertype-decodebuf"}}