Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timestamp-nano

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timestamp-nano - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

4

package.json
{
"name": "timestamp-nano",
"description": "Timestamp for 64-bit time_t, nanosecond precision and strftime",
"version": "0.1.2",
"version": "0.1.3",
"author": "@kawanet",

@@ -10,3 +10,3 @@ "bugs": {

"devDependencies": {
"int64-buffer": "^0.1.9",
"int64-buffer": "^0.1.10",
"jshint": "^2.9.5",

@@ -13,0 +13,0 @@ "mocha": "^4.0.1",

@@ -5,11 +5,16 @@ # Timestamp for 64-bit time_t, nanosecond precision and strftime

JavaScript's native `Date` object has limits at the range for 275 thousand years
and the precision of milliseconds.
[![Sauce Test Status](https://saucelabs.com/browser-matrix/timestamp-nano.svg)](https://saucelabs.com/u/timestamp-nano)
JavaScript's native `Date` will end at 275 thousand years later.
64-bit signed `time_t` still works for 292 billion years, on the other hand.
`Date` has only milliseconds precision since 20th century.
Now we need longer range and smaller precisions.
Try **[Live Demo](https://kawanet.github.io/timestamp-nano/demo/index.html)** now!
### Features
- Long long range: 64-bit signed `time_t` for 292 billion years.
- High precision: nanosecond = 0.000000001 second.
- Formatter: `"%Y-%m-%dT%H:%M:%S.%NZ"`, `"%a, %b %d %X %Y %z (%Z)"`
- Small: Just 3KB minified [timestamp.min.js](https://rawgit.com/kawanet/timestamp-nano/master/dist/timestamp.min.js) available for Web browsers.
- Longer range for `time_t`: `+292277026596-12-04T15:30:07Z`
- Nanoseconds precision: `1970-01-01T00:00:00.000000001Z`
- Bundled formatter: `"%Y-%m-%dT%H:%M:%S.%NZ"`, `"%a, %b %d %X %Y %z (%Z)"`
- Small: just 3KB minified [timestamp.min.js](https://rawgit.com/kawanet/timestamp-nano/master/dist/timestamp.min.js) available for Web browsers.
- No dependencies: no other module required. Portable pure JavaScript.

@@ -16,0 +21,0 @@

@@ -64,7 +64,7 @@ #!/usr/bin/env mocha -R spec

var YEARS = [2017, 2018, 2019, 2020];
var MONTHS = [1, 2, 12];
var DAYS = [1, 2, 28];
var HOURS = [0, 11, 12, 13, 23];
var MINUTES = [0, 1, 59];
var SECONDS = [0, 1, 59];
var MONTHS = [1, 12];
var DAYS = [1, 31];
var HOURS = [0, 12, 23];
var MINUTES = [0, 59];
var SECONDS = [0, 59];

@@ -124,2 +124,5 @@ // not all patterns supported at Timestamp#toString

it("" + year, function() {
// this may take longer seconds at some environment
this.timeout(10000);
var cnt = 0;

@@ -126,0 +129,0 @@ MONTHS.forEach(function(month) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc