node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

exif-date

Exif Date

NPM version NPM downloads Build status Test coverage

Parse an EXIF date string into a Date object.

Installation

npm install exif-date --save

Usage

import { parse, format } from 'exif-date'
 
parse('2016:07:11 21:33:20') //=> Date('2016-07-11T21:33:20.000Z') 
format(new Date('2016-07-11T21:33:20.000Z')) //=> '2016:07:11 21:33:20' 

P.S. Also parses sub-second precision and timezone offsets. Invalid attempts at parsing will return an invalid date. Invalid format attempts will return an empty string.

License

Apache 2.0