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

ez-local-time

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ez-local-time - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

38

app.js
'use strict'
module.exports = function(dt, r){
if(dt === 'd'){
var d = new Date().toLocaleString('en-US', { timeZone: r })
d= d.substring(0, d.indexOf(','))
return d;
}else if(dt === 't'){
var t = new Date().toLocaleString('en-US', { timeZone: r })
t= t.substring(t.indexOf(',')+2, t.length)
return t;
if(r === ''){
//no region specified, base off of runtime environment
if(dt === 'd'){
//date only
var d = new Date().toLocaleString('en-US', { timeZone: 'UTC' })
d= d.substring(0, d.indexOf(','))
return d;
}else if(dt === 't'){
//time only
}else{
//date and time
}
}else{
return new Date().toLocaleString('en-US', { timeZone: r })
//region is specified
if(dt === 'd'){
//date only
var d = new Date().toLocaleString('en-US', { timeZone: r })
d= d.substring(0, d.indexOf(','))
return d;
}else if(dt === 't'){
//time only
var t = new Date().toLocaleString('en-US', { timeZone: r })
t= t.substring(t.indexOf(',')+2, t.length)
return t;
}else{
//date and time
return new Date().toLocaleString('en-US', { timeZone: r })
}
}
}
{
"name": "ez-local-time",
"version": "0.0.1",
"version": "0.0.2",
"description": "Use raw Javascript to get local times and dates",

@@ -5,0 +5,0 @@ "main": "app.js",

@@ -1,1 +0,1 @@

# Local-Time
# ez-local-time v1.0.0
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