Coder Social home page Coder Social logo

simple-date-time's Introduction

simple-date-time

date and time library for common lisp

simple-date-time's People

Contributors

quek avatar

Stargazers

Bruno Dias avatar Anthony Green avatar Jorge Gomez avatar Johannes Martinez Calzada avatar Priyadarshan avatar Alexander I.Grafov avatar Jordan Brown avatar TatriX avatar Jonathan Rioux avatar Takaya OCHIAI avatar Joshua Bemman avatar Jeffrey Cunningham avatar  avatar gihnius avatar José Santos Martins Pereira avatar  avatar

Watchers

 avatar James Cloos avatar Eugene Yukhno avatar  avatar  avatar

simple-date-time's Issues

Time-zone in to-universal-time

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.

Use of month+ etc.

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

Addition of negative number of days leads to unexpected behaviour

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

Clone date object?

Method day+ is destructive. So when I need original date and modified one I cant't see easy way to do it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.