Comments (7)
from chez-srfi.
My current design is at https://github.com/johnwcowan/r7rs-work/blob/master/TimeAdvancedCowan.md. It is both more comprehensive than SRFI 19 (it handles time folds, for example) and less so (it does not make much sense to convert monotonic time to hours, minutes, and seconds, much less a calendar date, since the epoch is unknown). It does not include anything about formatting.
from chez-srfi.
from chez-srfi.
Leap seconds are added pretty sparsely nowadays: only three leap seconds in the last decade, last one was in 2016. So updating the hard-coded tables in Scheme codebases ought to be a good-enough first pass.
As a long-term solution, +1 for system call. As a fallback, use hard-coded table or read a well-known file like @weinholt suggests.
A while ago, Windows added a feature whereby its clock can display :60 when a leap second occurs. This must mean they also added a system call where one can get requisite information, and unless I misthought something, they have to store a leap second table in the kernel. Hopefully they have a syscall to read that table into userland, but not sure.
from chez-srfi.
For future Scheming, I'd like a simple SRFI with:
(leap-second-table) -> return a vector of known leap seconds as integers; each positive value is a positive leap second, each negative value is a negative leap second; the magnitude is the timestamp since 1970
(tai-now) and (utc-now) -> get the current time since 1970 in TAI and UTC. could be returned as seconds; nanoseconds pair/values or seconds.fractional_seconds inexact real or seconds integer.
(tai->utc timestamp table) and (utc->tai timestamp table) -> convert between tai and utc using the given leap second table.
from chez-srfi.
from chez-srfi.
@johnwcowan has a plan for at least one new time SRFI since SRFI 19 had some kind of fundamental problem. I forget the details.
from chez-srfi.
Related Issues (20)
- README misleading regarding "upstream" HOT 1
- Bugs in (srfi :126 r6rs-hashtables) HOT 4
- Chez parameters are not SRFI-39 compatible HOT 4
- Bug in append-map from SRFI-1
- SRFI 146: Mappings HOT 2
- Setup Continuous Integration HOT 1
- Out-of-context identifier in SRFI 42 HOT 3
- Importing partial libraries HOT 3
- bug in srfi-1 fold-right HOT 4
- Port arew's libraries to chez-srfi HOT 2
- Avoid the use of make-coroutine-generator in srfi-158 HOT 2
- (srfi :67 comparison-procedures) is not usable in Chez Scheme HOT 5
- It does not seem to support windows HOT 1
- SRFI 15 (fluid-let) HOT 5
- SRFI 111 boxes implementation is not portable HOT 1
- Duplicate exports in SRFI 113 - sets-and-bags
- Improve or remove install script and document HOT 9
- windows support HOT 2
- (srfi :14 char-sets) only handles latin-1 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chez-srfi.