date and time library for common lisp
quek / simple-date-time Goto Github PK
View Code? Open in Web Editor NEWdate and time library for common lisp
date and time library for common lisp
Hello, I like & use simple-date-time library for its nice simplicity.
However, in the following code something wrong is occurring:
(- (encode-universal-time 0 0 0 1 1 2000 0)
(simple-date-time:to-universal-time
(simple-date-time:from-string "Sat, 01 Jan 2000 00:00:00 GMT")))
=> 32400
I think in function to-universal-time
at date-time.lisp, encode-universal-time
needs time-zone
.
Because the default value of time-zone
in encode-universal-time
depends on system environment,
and 32400 = (* 9 60 60)
, 9 is JST offset.
c.f. http://clhs.lisp.se/Body/f_encode.htm , last example.
How should month+ etc be correctly used?
I wanted to do something like
(let* ((dt-right (from-posix-time ts))
(dt-left (month+ dt-right
(- +width-in-months+)))
but that doesn't work, as month+ modifies its argument!
That is unexpected, and as there's no copy operator, the only way to get this
is now something like
(let* ((dt-right (from-posix-time ts))
(dt-left (month+ (deserialize (serialize dt-right))
(- +width-in-months+)))
which looks really bad.
Shouldn't there be some functional interface, instead of modifying the passed
arguments?
Regards,
Phil
I believe it's strange, but
(dt:day+ (dt:make-date 2020 10 2) -5)
returns
#<date-time 2020-09-30 00:00:00.000 00007fcd734e7030>
when I'd expected 2020-09-27.
Not sure how to get quicklisp package version. Tried on Fedora 32 x64 with SBCL-2.0.1, CLISP-2.49.93 and ECL-16.1.3
simple-date-time/simple-date-time.asd
Line 6 in d6992af
There is more than one "BSD" license. For example:
Which BSD license does this project use?
Please consider adding :description, :author and :license information to your ASDF system. This will greatly help Quicklisp users and make it easier for them to report bugs.
More information:
http://blog.quicklisp.org/2015/05/looking-for-more-metadata.html
https://www.quicklisp.org
Method day+ is destructive. So when I need original date and modified one I cant't see easy way to do it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.