{"action":"created","issue":{"url":"https://api.github.com/repos/serv-terr/pbl_met/issues/7","repository_url":"https://api.github.com/repos/serv-terr/pbl_met","labels_url":"https://api.github.com/repos/serv-terr/pbl_met/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/serv-terr/pbl_met/issues/7/comments","events_url":"https://api.github.com/repos/serv-terr/pbl_met/issues/7/events","html_url":"https://github.com/serv-terr/pbl_met/issues/7","id":320483058,"number":7,"title":"In pbl_time, would not it be a good thing to have two new functions converting between REAL(8) time stamps and date/time with sub-second resolution?","user":{"login":"mafavaron","id":2512285,"avatar_url":"https://avatars0.githubusercontent.com/u/2512285?v=4","gravatar_id":"","url":"https://api.github.com/users/mafavaron","html_url":"https://github.com/mafavaron","followers_url":"https://api.github.com/users/mafavaron/followers","following_url":"https://api.github.com/users/mafavaron/following{/other_user}","gists_url":"https://api.github.com/users/mafavaron/gists{/gist_id}","starred_url":"https://api.github.com/users/mafavaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafavaron/subscriptions","organizations_url":"https://api.github.com/users/mafavaron/orgs","repos_url":"https://api.github.com/users/mafavaron/repos","events_url":"https://api.github.com/users/mafavaron/events{/privacy}","received_events_url":"https://api.github.com/users/mafavaron/received_events","type":"User","site_admin":false},"labels":[{"id":250282742,"url":"https://api.github.com/repos/serv-terr/pbl_met/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"mafavaron","id":2512285,"avatar_url":"https://avatars0.githubusercontent.com/u/2512285?v=4","gravatar_id":"","url":"https://api.github.com/users/mafavaron","html_url":"https://github.com/mafavaron","followers_url":"https://api.github.com/users/mafavaron/followers","following_url":"https://api.github.com/users/mafavaron/following{/other_user}","gists_url":"https://api.github.com/users/mafavaron/gists{/gist_id}","starred_url":"https://api.github.com/users/mafavaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafavaron/subscriptions","organizations_url":"https://api.github.com/users/mafavaron/orgs","repos_url":"https://api.github.com/users/mafavaron/repos","events_url":"https://api.github.com/users/mafavaron/events{/privacy}","received_events_url":"https://api.github.com/users/mafavaron/received_events","type":"User","site_admin":false},"assignees":[{"login":"mafavaron","id":2512285,"avatar_url":"https://avatars0.githubusercontent.com/u/2512285?v=4","gravatar_id":"","url":"https://api.github.com/users/mafavaron","html_url":"https://github.com/mafavaron","followers_url":"https://api.github.com/users/mafavaron/followers","following_url":"https://api.github.com/users/mafavaron/following{/other_user}","gists_url":"https://api.github.com/users/mafavaron/gists{/gist_id}","starred_url":"https://api.github.com/users/mafavaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafavaron/subscriptions","organizations_url":"https://api.github.com/users/mafavaron/orgs","repos_url":"https://api.github.com/users/mafavaron/repos","events_url":"https://api.github.com/users/mafavaron/events{/privacy}","received_events_url":"https://api.github.com/users/mafavaron/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-05-05T06:03:02Z","updated_at":"2018-05-05T14:06:48Z","closed_at":null,"author_association":"COLLABORATOR","body":"To date, subroutines like PackTime and UnpackTime exist which perform the same task between INTEGER(4) timestamps and date/time parts.\r\n\r\nSomething similar should happen with REAL(8) time stamps, to allow users a more direct use."},"comment":{"url":"https://api.github.com/repos/serv-terr/pbl_met/issues/comments/386808075","html_url":"https://github.com/serv-terr/pbl_met/issues/7#issuecomment-386808075","issue_url":"https://api.github.com/repos/serv-terr/pbl_met/issues/7","id":386808075,"user":{"login":"mafavaron","id":2512285,"avatar_url":"https://avatars0.githubusercontent.com/u/2512285?v=4","gravatar_id":"","url":"https://api.github.com/users/mafavaron","html_url":"https://github.com/mafavaron","followers_url":"https://api.github.com/users/mafavaron/followers","following_url":"https://api.github.com/users/mafavaron/following{/other_user}","gists_url":"https://api.github.com/users/mafavaron/gists{/gist_id}","starred_url":"https://api.github.com/users/mafavaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafavaron/subscriptions","organizations_url":"https://api.github.com/users/mafavaron/orgs","repos_url":"https://api.github.com/users/mafavaron/repos","events_url":"https://api.github.com/users/mafavaron/events{/privacy}","received_events_url":"https://api.github.com/users/mafavaron/received_events","type":"User","site_admin":false},"created_at":"2018-05-05T14:06:48Z","updated_at":"2018-05-05T14:06:48Z","author_association":"COLLABORATOR","body":"Here some of my considerations (after a bit of thought).\r\n\r\nSupporting REAL(8) time stamps is surely possible, and more than advisable.\r\n\r\nBut, REAL(8) values encompass a range incomparably larger than INTEGER(4), so the problem arises of deciding whether to extend the current PackTime/Unpack time or not.\r\n\r\nTo date, if you try converting the largest possible INTEGER(4) value to date/time you get this final date:\r\n\r\n    2038-01-19 03:14:07\r\n\r\nThe minimum is, of course, the Epoch,\r\n\r\n    1970-01-01 00:00:00\r\n\r\nIs January 18, 2038, far away enough? A bit less than 20 years from now: if we're lucky, many of us who are reading this may aspect to be still alive by then - maybe, still maintaining the code base? Not that much, after all...\r\n\r\nBut on the other side, PackTime/UnpackTime are used in tons of legacy code (not only at Servizi Territorio - that would not be a huge problem - but also at ARPA Lombardy, ARPA Lazio, ARPA Puglia, ENICHEM, ENIPOWER, A2A, ...). I'm quite afraid it spread like a virus.\r\n\r\nIt would be a _very_ good idea to migrate progressively, inside _pbl_met_ and outside of it, from INTEGER(4) to INTEGER(8) time stamps.\r\n\r\nI'm so sorry Fortran does not contain a data type like UNSIGNED INTEGER, because in this case the maximum allowed date/time would have been much larger.\r\n\r\nINTEGER(8) has a problem, however: IEEE REAL(8) can represent only a subset of it! Larger than the span of INTEGER(4) however, and this should be more than enough to cover quite a part of the auspicable evolutionary time span of human species.\r\n\r\nSo, we might agree to use INTEGER(8) time stamps, but restricting their validity range between 0 and an \"arbitrarily\" set upper limit which\r\n1) is fully representable without precision loss by a REAL(8), and\r\n2) is reasonably large to accommodate the time span of a typical human civilisation - in the meanwhile, someone will figure out something better.\r\n\r\n(The typical programmer hubris? Surely the _pbl_met_ will not endure that much. At least, I hope it will replaced by something better within ten years)."}}
{"actor":{"display_login":"mafavaron"}}