New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cannonian

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

cannonian

Metric time converter

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Cannonian.js

##Install ###In Browser

###In Node.js Install using:

npm install cannonian

Include using:

var Cannonian = require('cannonian');

##Usage ###Constructor

var cannonian = new Cannonian();

The constructor has 3 parameters:

  • p - Something to base the time off of. Default: time of execution
  • stz - Standard timezone. Default: calculated from Date objects
  • ctz - Cannonian timezone. Default: calculated from Standard timezone

####Recognised p formats

  • Cannonian Object - e.g. new Cannonian()
  • Date objects - e.g. new Date()
  • Date strings - e.g. 'Tues Jan 1 2013 06:45:00 GMT+0000 (GMT)'
  • Decimals - e.g. 0.5
  • Standard time strings - '12:45:30'
  • Cannonian time strings - '53.125'

###Public Functions ####toStan

var cannonian = new Cannonian('12:00');
cannonian.toStan(3); // '12:00:00'

Returns the standard time in 24-hour string.

####toCann

var cannonian = new Cannonian('12:00');
cannonian.toCann(3); // '50.000'

Returns the cannononian time in decimal-style string.

####ToDec

var cannonian = new Cannonian('12.345');
cannonian.toDec(5); // 0.12345

Returns a decimal value equivalent to cannonian time.

Keywords

FAQs

Package last updated on 20 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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