Giter VIP home page Giter VIP logo

Comments (5)

chenkan0104 avatar chenkan0104 commented on June 24, 2024

我觉得你得注意一下javascript的时间set函数,看看参数是从零开始还是从1开始,挺坑人的。

发件人: David Jiang [mailto:[email protected]]
发送时间: 2014年3月18日 13:39
收件人: hackerzhou/Love
主题: [Love] 时间计算错误你们有遇到么? (#5)

比如我用这个代码计算了一个2013年10月30日到现在(14年3月18日)的时间,明明是139天但是却显示在网站上是108天,是我使用错误还是什么错误??


Reply to this email directly or view it on GitHub #5 . https://github.com/notifications/beacon/3645791__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcxMDc0MDMxNiwiZGF0YSI6eyJpZCI6Mjc5MTIzODR9fQ==--a0f4efb62c3dd205a21d4d2d17cb356384f5d62c.gif

from love.

drjinying avatar drjinying commented on June 24, 2024

我也遇到了这个问题,但是变换一下表达就对了,原本为什么错,我也搞不清楚。
我commit的上面有这部分代码。我是按天计算的,可供参考。

from love.

hackerzhou avatar hackerzhou commented on June 24, 2024

看来你们都不知道javascript的date是从0-11的。。。

from love.

drjinying avatar drjinying commented on June 24, 2024

== 我去...服了,看来我的程序员思维还不够深入啊!

from love.

wenge9487 avatar wenge9487 commented on June 24, 2024

对 会差一个月,因为是从0开始算的= =

from love.

Related Issues (20)

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.