{"_id":"julian","_rev":"6-2f4609c04aa852ee5ced0aee6f5514c8","name":"julian","description":"Convert between Date object and Julian dates used in astronomy and history","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"julian","version":"0.1.0","description":"Convert between Date object and Julian dates used in astronomy and history","main":"index.js","scripts":{"test":"tap test"},"repository":{"type":"git","url":"https://github.com/stevebest/julian.git"},"keywords":["julian","date","conversion","epoch","time","calendar","astronomy"],"author":{"name":"Stepan Stolyarov","email":"stepan.stolyarov@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/stevebest/julian-date/issues"},"devDependencies":{"tap":"~0.4.6"},"_id":"julian@0.1.0","dist":{"shasum":"645a8cbfc366b7affcb48badcfb9eb9b5e68abdf","tarball":"https://registry.npmjs.org/julian/-/julian-0.1.0.tgz","integrity":"sha512-QHk/2iA6T3VYMdr8/B2JjRlAClOBjwhlZGZSXiXWAHE0FKg4YBZOry/G3Vkp4bdFe3G69BoMwf01kiuMZxVriw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFiz+b2n4Z19q8ETrUccQLmJfLm9NaJiC1EnKpJ/ZFvAIhAIUSNOYa/UECn9NHVda930hG9j/h95J0arq60n6Hw06T"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"stevebest","email":"stepan.stolyarov@gmail.com"},"maintainers":[{"name":"stevebest","email":"stepan.stolyarov@gmail.com"}]},"0.2.0":{"name":"julian","version":"0.2.0","description":"Convert between Date object and Julian dates used in astronomy and history","main":"index.js","scripts":{"test":"tap test"},"repository":{"type":"git","url":"git+https://github.com/stevebest/julian.git"},"keywords":["julian","date","conversion","epoch","time","calendar","astronomy"],"author":{"name":"Stepan Stolyarov","email":"stepan.stolyarov@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/stevebest/julian-date/issues"},"devDependencies":{"tap":"^10.3.0"},"gitHead":"64df53abbe43d2c07d6dc2b4fc03a3e9c182ee76","homepage":"https://github.com/stevebest/julian#readme","_id":"julian@0.2.0","_shasum":"8d7bfc360d76cc89d5d83b2137d860a18e47e2f1","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"stevebest","email":"stepan.stolyarov@gmail.com"},"dist":{"shasum":"8d7bfc360d76cc89d5d83b2137d860a18e47e2f1","tarball":"https://registry.npmjs.org/julian/-/julian-0.2.0.tgz","integrity":"sha512-rpBcYy7SiT9ogHfxcJQDLycCVGx7nTvAbu0wm3dVnpY71P7asAFT5oOOLrlsDqQYS6qenhE/NHfhtMR7AQqWSQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3NyaGnpGWkjfxiATZlGiQd19aTLPBAPJ/hMzEH+mBzAiBLF0Ary02nAYEUCAXD3qv7pd+CI8aZaQ7GTcr946qWRA=="}]},"maintainers":[{"name":"stevebest","email":"stepan.stolyarov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/julian-0.2.0.tgz_1499701039731_0.4932260836940259"}}},"readme":"# julian\n\nConvert between JavaScript's [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object and [Julian dates](http://en.wikipedia.org/wiki/Julian_day) used in astronomy and history.\n\n## usage\n\n```javascript\n  var julian = require('julian');\n\n  var now = new Date();           // Let's say it's Thu, 21 Nov 2013 10:47:02 GMT\n  var jd = '';\n\n  console.log(jd = julian(now));  // -> '2456617.949335'\n  console.log(julian.toDate(jd)); // -> Timestamp above in local TZ\n```\n\n## api\n\n### julian(date)\n\nConvert a `Date` into a string representing Julian Date.\n\n### julian.toDate(jd)\n\nConvert a Julian Date to a javascript `Date`.\n\n### julian.toJulianDay(date)\n\nreturn a javascript `Date` or `timestamp` to the julian day.\nAn integer day is returned.\n\n### julian.toMillisecondsInJulianDay (date)\n\nreturns the number of milliseconds since the start of\nthe julian day. Note, the julian day starts at noon,\nnot at midnight. This seems strange, if you don't have\nan accurate clock, then finding noon accurately is easy\n(from the sun) but finding midnight is not easy. Julian\ndays have been used by astronomers since before accurate clocks.\n\n### julian.fromJulianDayAndMilliseconds(day, ms)\n\nConverts a julian day and ms back to a javascript timestamp.\nAlso, note that this is reversable with out floating point errors.\n\n``` js\nvar date = Date.now()\n\nassert.equal(\n  julian.fromJulianDayAndMilliseconds(\n    julian.toJulianDay(date),\n    julian.toMillisecondsInJulianDay(date)\n  ),\n  date\n)\n```\n\n## notice\n\nDate systems are a mess. Leap years, leap seconds, epochs, different calendars using the same nomenclature, different countries using different calendars at the same time, etc.\n\nThis library doesn't even try to cope with all that shit.\n\nIf you want to display calendar dates in format appropriate for a given culture at a given time in history - well, first of all, good luck to you. For example, the [*October* Revolution](http://en.wikipedia.org/wiki/October_Revolution) took place in what most of us now call *November*. That's because in Tsar's Russia they still used obsolete Julian calendar until bolsheviks finally adopted Gregorian. Hey thanks, Lenin!\n\nLuckily for historians and astronomers, they can just say the revolution began on 2421540 Julian Day, and that's the whole point. You don't mess with naming days, you just count them. Day 0 would be *1 January 4713 BC*. Or is that *27 Nov 4714 BC*? Fuck.\n\n## license\n\nMIT\n\n## author\n\nStepan Stolyarov <stepan.stolyarov@gmail.com>\n\n\n","maintainers":[{"name":"stevebest","email":"stepan.stolyarov@gmail.com"}],"time":{"modified":"2022-06-19T07:18:35.571Z","created":"2013-11-21T11:37:48.981Z","0.1.0":"2013-11-21T11:37:56.095Z","0.2.0":"2017-07-10T15:37:20.946Z"},"author":{"name":"Stepan Stolyarov","email":"stepan.stolyarov@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/stevebest/julian.git"},"homepage":"https://github.com/stevebest/julian#readme","keywords":["julian","date","conversion","epoch","time","calendar","astronomy"],"bugs":{"url":"https://github.com/stevebest/julian-date/issues"},"license":"MIT","readmeFilename":"README.md"}