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

react-native-timezones

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-timezones

React Native library to extract mobile timezone

  • 2.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Timezone

A Simple react native module to get Timezone of the Android/iOS device.

Motivation

For a project of mine, I had to acquire the current selected timezone of the user. But unfortunately I could not find any react native package or react native in-build function which facilitates this. Thus I created a small library.

Compatibility

Timezone version 2.0.0 only support React Native version 0.62.3 and above due to React Native Regular Expression Denial of Service (ReDoS) vulnerability.

React native versionTestedResult
0.62.3 +

Installation

npm i --save react-native-timezone

iOS

Do cd ios/ && pod install.

Usage

import TimeZone from 'react-native-timezone';

getTimeZone = async() => {
 const timeZone = await TimeZone.getTimeZone().then(zone => zone);
 console.log({ timeZone });
}

API

APIDescription
getTimeZoneAndroid : Returns timezone ID using java.util.TimeZone.getID()
iOS : This always reflects the current system time zone using localTimeZone of NSTimeZone

Keywords

FAQs

Package last updated on 15 Oct 2021

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