Coder Social home page Coder Social logo

tickstodatetime's Introduction

tickstodatetime's People

Contributors

mharen avatar

Stargazers

 avatar Michael Grant avatar  avatar Gabriel Weidmann avatar Mehmet Ceylan avatar T. Russell Schwartz avatar Chris Johnston avatar Karlo Bistrički avatar Jack Casey avatar  avatar Mattias Cibien avatar Charlie Smith avatar  avatar Manny Aparaschivei avatar Mark City avatar  avatar Naveen Bhat avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

tickstodatetime's Issues

Adding 10000 to ticks does not add a millisecond. Subtracting 10000 does subtract 1ms from the date.

https://stackoverflow.com/a/77612268/295783

638315425210000000 is 2023-09-29​T00:02:01.000Z plus 10000
638315425210010000 is 2023-09-29​T00:02:01.000Z is the same according to the site

Whereas

638338147200000000 is 2023-10-25​T07:12:00.000Z minus 10000

638338147199990000 is 2023-10-25​T07:11:59.999Z IS one millisecond less as expected

let ticksInMilliseconds = 10000
//to add milliseconds to tick
const startTick = "638315425210000000"; // valid INT in Chrome
console.log("str",startTick,"int",+startTick)
const millisecondsAdded = (+startTick) +  ticksInMilliseconds 
//to reduce one millisecond
const endTick = "638338147200000000"
const millisecondReduced = (+endTick) - ticksInMilliseconds

console.log(startTick,millisecondsAdded)
console.log(endTick,millisecondReduced)

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.