{"action":"created","issue":{"url":"https://api.github.com/repos/leafo/lapis/issues/562","repository_url":"https://api.github.com/repos/leafo/lapis","labels_url":"https://api.github.com/repos/leafo/lapis/issues/562/labels{/name}","comments_url":"https://api.github.com/repos/leafo/lapis/issues/562/comments","events_url":"https://api.github.com/repos/leafo/lapis/issues/562/events","html_url":"https://github.com/leafo/lapis/issues/562","id":247119934,"number":562,"title":"Inverse of db.format_date ?","user":{"login":"Guard13007","id":15093567,"avatar_url":"https://avatars3.githubusercontent.com/u/15093567?v=4","gravatar_id":"","url":"https://api.github.com/users/Guard13007","html_url":"https://github.com/Guard13007","followers_url":"https://api.github.com/users/Guard13007/followers","following_url":"https://api.github.com/users/Guard13007/following{/other_user}","gists_url":"https://api.github.com/users/Guard13007/gists{/gist_id}","starred_url":"https://api.github.com/users/Guard13007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guard13007/subscriptions","organizations_url":"https://api.github.com/users/Guard13007/orgs","repos_url":"https://api.github.com/users/Guard13007/repos","events_url":"https://api.github.com/users/Guard13007/events{/privacy}","received_events_url":"https://api.github.com/users/Guard13007/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-01T16:01:53Z","updated_at":"2017-08-02T10:54:42Z","closed_at":"2017-08-02T10:54:42Z","body":"I don't know if it is common enough a problem to warrant it, but I would like an inverse of the `db.format_date` function for converting a database entry back to Unix time.\r\n\r\nI have implemented it this way for my own use, but I have no idea if it's even a good way of doing it:\r\n\r\n```moonscript\r\ndb_time_to_unix = (time) ->\r\n  tab = {\r\n    year: tonumber time\\sub 1, 4\r\n    month: tonumber time\\sub 6, 7\r\n    day: tonumber time\\sub 9, 10\r\n    hour: tonumber time\\sub 12, 13\r\n    min: tonumber time\\sub 15, 16\r\n    sec: tonumber time\\sub 18, 19\r\n  }\r\n\r\n  return os.time tab\r\n```\r\n\r\nEdit: I'm also not 100% sure that's correct, or if it can be fucked up by DST settings or something. I don't think it can, but I'm also not sure how to verify it.\r\n"},"comment":{"url":"https://api.github.com/repos/leafo/lapis/issues/comments/319639065","html_url":"https://github.com/leafo/lapis/issues/562#issuecomment-319639065","issue_url":"https://api.github.com/repos/leafo/lapis/issues/562","id":319639065,"user":{"login":"Guard13007","id":15093567,"avatar_url":"https://avatars3.githubusercontent.com/u/15093567?v=4","gravatar_id":"","url":"https://api.github.com/users/Guard13007","html_url":"https://github.com/Guard13007","followers_url":"https://api.github.com/users/Guard13007/followers","following_url":"https://api.github.com/users/Guard13007/following{/other_user}","gists_url":"https://api.github.com/users/Guard13007/gists{/gist_id}","starred_url":"https://api.github.com/users/Guard13007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guard13007/subscriptions","organizations_url":"https://api.github.com/users/Guard13007/orgs","repos_url":"https://api.github.com/users/Guard13007/repos","events_url":"https://api.github.com/users/Guard13007/events{/privacy}","received_events_url":"https://api.github.com/users/Guard13007/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T10:54:42Z","updated_at":"2017-08-02T10:54:42Z","body":"Ah, didn't realize that. Why not include your implementation as a function in Lapis?"}}
{"actor":{"display_login":"Guard13007"}}