Socket
Socket
Sign inDemoInstall

parse-tzdata-coordinate

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-tzdata-coordinate

Parse a coordinate string in zone.tab format e.g. `-2439+02555`


Version published
Maintainers
1
Install size
15.3 kB
Created

Readme

Source

parse-tzdata-coordinate

NPM version Bower version Build Status Coverage Status Dependency Status devDependency Status

Parse a coordinate string in zone.tab format

import parseTzdataCoordinate from 'parse-tzdata-coordinate';

parseTzdataCoordinate('+394606-0860929');
/*
  => {
    latitude: {
      sign: '+',
      degree: 39,
      minute: 46,
      second: 6
    },
    longitude: {
      sign: '-',
      degree: 86,
      minute: 9,
      second: 29
    }
  }
*/

Installation

npm

npm install parse-tzdata-coordinate

Bower

bower install parse-tzdata-coordinate

API

parseTzdataCoordinate(str)

str: String
Return: Object

It takes a string of time zone coordinates in tz database format:

Latitude and longitude of the zone's principal location in ISO 6709 sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS, first latitude (+ is north), then longitude (+ is east).

and returns an object in the form:

{
  latitude: {
    sign: <string> ('+' or '-'),
    degree: <int>,
    minute: <int>,
    [second: <int>] (if available)
  },
  longitude: {
    sign: <string> ('+' or '-'),
    degree: <int>,
    minute: <int>,
    [second: <int>] (if available)
  }
}
parseTzdataCoordinate('+394606-0860929');
/*
  => {
    latitude: {
      sign: '+',
      degree: 34,
      minute: 31
    },
    longitude: {
      sign: '+',
      degree: 69,
      minute: 12
    }
  }
*/

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.

Keywords

FAQs

Last updated on 15 Jun 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc