All Projects → prantlf → Date Fns Timezone

prantlf / Date Fns Timezone

Licence: mit
Parsing and formatting date strings using IANA time zones for date-fns.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Date Fns Timezone

Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+1924.58%)
Mutual labels:  time, date, timezone
time machine
A date and time API for Dart
Stars: ✭ 120 (+1.69%)
Mutual labels:  time, date, timezone
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+1580.51%)
Mutual labels:  time, date, timezone
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+1419.49%)
Mutual labels:  time, date, timezone
Js Joda
🕑 Immutable date and time library for javascript
Stars: ✭ 1,298 (+1000%)
Mutual labels:  time, date, timezone
TimesDates.jl
Nanosecond resolution for Time and Date, TimeZones
Stars: ✭ 28 (-76.27%)
Mutual labels:  time, date, timezone
temps-lite
A smart, good-looking little app which tries to speak your language the way you are used to.
Stars: ✭ 40 (-66.1%)
Mutual labels:  time, date, timezone
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (-22.03%)
Mutual labels:  time, date, timezone
Timezone Support
Lightweight time zone support for your applications or other date libraries.
Stars: ✭ 90 (-23.73%)
Mutual labels:  time, date, timezone
hs-hourglass
efficient and simpler time API for haskell
Stars: ✭ 43 (-63.56%)
Mutual labels:  time, date, timezone
nepali-datetime
Python's core datetime inspired nepali datetime (BS date & NPT) package 🇳🇵
Stars: ✭ 36 (-69.49%)
Mutual labels:  time, date, timezone
Date Fns Tz
Complementary library for date-fns v2 adding IANA time zone support
Stars: ✭ 385 (+226.27%)
Mutual labels:  time, date, timezone
Dateparse
GoLang Parse many date strings without knowing format in advance.
Stars: ✭ 1,365 (+1056.78%)
Mutual labels:  time, date
Zulu
A drop-in replacement for native Python datetimes that embraces UTC.
Stars: ✭ 52 (-55.93%)
Mutual labels:  time, date
Date And Time
A Minimalist DateTime utility for Node.js and the browser
Stars: ✭ 99 (-16.1%)
Mutual labels:  time, date
Posix tz db
Generates POSIX timezones strings
Stars: ✭ 57 (-51.69%)
Mutual labels:  time, timezone
Pickadate.js
The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
Stars: ✭ 7,753 (+6470.34%)
Mutual labels:  time, date
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+803.39%)
Mutual labels:  time, date
When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+843.22%)
Mutual labels:  time, date
Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (-40.68%)
Mutual labels:  time, date

date-fns-timezone

NPM version Build Status Coverage Status Codacy Badge Dependency Status devDependency Status JavaScript Style Guide

Provides parsing and formatting date strings and time zone conversions supporting IANA time zones, following the design of functions in date-fns. List of canonical time zone names is provided by timezone-support.

Table of Contents

Synopsis

const { listTimeZones } = require('timezone-support')
const { parseFromTimeZone, formatToTimeZone } = require('date-fns-timezone')

// List canonical time zone names: [ 'Africa/Abidjan', ... ]
const timeZones = listTimeZones()

// Set the date to "2018-09-01T16:01:36.386Z"
const date = parseFromTimeZone('2018-09-01 18:01:36.386', { timeZone: 'Europe/Berlin' })

// Set the output to "1.9.2018 18:01:36.386 GMT+02:00 (CEST)"
const date = new Date('2018-09-01Z16:01:36.386Z')
const format = 'D.M.YYYY HH:mm:ss.SSS [GMT]Z (z)'
const output = formatToTimeZone(date, format, { timeZone: 'Europe/Berlin' })

Installation and Getting Started

This module can be installed in your project using NPM or Yarn. Make sure, that you use Node.js version 6 or newer.

$ npm i date-fns-timezone --save
$ yarn add date-fns-timezone

Functions are exposed as named exports from the package modules, for example:

const { parseFromTimeZone, formatToTimeZone } = require('date-fns-timezone')

You can read more about the module loading in other environments, like with ES6 or in web browsers. Usage scenarios demonstrate applications of this library in typical real-world scenarios. The API reference lists all functions with a description of their functionality.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2018-10-10 v0.1.4 Fix compatibility with IE. Thanks, Andrii!
  • 2018-10-06 v0.1.2 Add TypeScript export declarations.
  • 2018-09-19 v0.1.0 Add parseString without a time zone to cover a gap in date-fns
  • 2018-09-17 v0.0.1 Initial release

License

Copyright (c) 2018 Ferdinand Prantl

Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].