Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fe0412e
Showing
10 changed files
with
3,854 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = tab | ||
tab_width = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{md,yml}] | ||
indent_style = space | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.nyc_output | ||
coverage | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
branches: | ||
except: /^v\d/ | ||
language: node_js | ||
node_js: node | ||
after_script: node_modules/.bin/nyc report --reporter=text-lcov | npx coveralls | ||
env: | ||
global: | ||
- COVERALLS_SERVICE_NAME=travis-pro | ||
- secure: i6O9ZYcS5l1zAJCne1uM57TTxvXBShLHUi3PNPalSETR8C4xH4qDiiLoKDh+lzbAiKhDz0F4Xap1rQlC5sBWCtzQMpPZuULXdarWnmJS+el8Mgu0/D+jPi1IUfvJ6CtVpwGeHz2fuad7uEiPvjInMLXQVilzcn/kR/AKxKMet5Xk0fybmqzV1H4ClEPq/apHpfhSFib5AisnxXkDLDb4lLtlTVYsP39lCSvmsyDy1oTO8gTFYB8d/F28FQXu0KDl00cKDhBSWQRSWhHgOOiU/VxRtJ61u54PvLBUQ8aXfJjS7kk+gD4xfhdjznGtqxddWPIC5DhJCpzOguYQry6QKUgwpG5PTslTan4R4K45/WEdiBWTbHYEPcxtG+6SQYwdYIhxtlC06NLTAJEQvL3kMrlU5AKRrJag2u/wMmSr6/9pM2jM9/eNo6YN033m4LZR01VJ8H8Hp/JmTBLR3zzSEjGVA23KLBBDb6ORPMG5RZAxJoEjKnTN58TfBDlicc04LVNc87VC2t6uWnGHUloleR+iCADxLm7Wi9zQsc5vMl5Jjdm+AqwcA3UAABto26Gtiap3lP1ejV+DvypndURtcsPckZJvHYZzIdWj1HdOCUtAilBboPNA9krG/WamiJFpJgEj7qjKQhHF0Iv9Psg8/bZ6pmh9ofjJv+kZKHc5wxk= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ISC License (ISC) | ||
Copyright 2018 Shinnosuke Watanabe | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# current-exif-date | ||
|
||
[![npm version](https://img.shields.io/npm/v/current-exif-date.svg)](https://www.npmjs.com/package/current-exif-date) | ||
[![Build Status](https://travis-ci.com/shinnn/current-exif-date.svg?branch=master)](https://travis-ci.com/shinnn/current-exif-date) | ||
[![Coverage Status](https://img.shields.io/coveralls/shinnn/current-exif-date.svg)](https://coveralls.io/github/shinnn/current-exif-date?branch=master) | ||
|
||
Get the current date as an Exif date format | ||
|
||
```javascript | ||
const currentExifDate = require('current-exif-date'); | ||
|
||
currentExifDate(); //=> '2018:06:15 10:13:05' | ||
``` | ||
|
||
According to the [Exif specification (PDF)](http://www.cipa.jp/std/documents/e/DC-008-Translation-2016-E.pdf), the format of `DateTime`, `DateTimeOriginal` and `DateTimeDigitaized` is: | ||
|
||
> "YYYY:MM:DD HH:MM:SS" with time shown in 24-hour | ||
format, and the date and time separated by one blank character | ||
|
||
## Installation | ||
|
||
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm). | ||
|
||
``` | ||
npm install current-exif-date | ||
``` | ||
|
||
## API | ||
|
||
```javascript | ||
const currentExifDate = require('current-exif-date'); | ||
``` | ||
|
||
### currentExifDate() | ||
|
||
Return: `string` | ||
|
||
Note that the resultant date indicates the *local* time. | ||
|
||
```javascript | ||
// In Japan | ||
|
||
new Date().toString(); //=> 'Fri Jun 15 2018 01:04:30 GMT+0900 (JST)' | ||
new Date().toUTCString(); //=> 'Thu, 14 Jun 2018 16:04:30 GMT' | ||
|
||
currentExifDate(); //=> '2018:06:15 01:04:30', not '2018:06:14 01:04:30 16:04:30' | ||
``` | ||
|
||
## License | ||
|
||
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
var format = require('exif-date').format; | ||
|
||
module.exports = function currentExifDate() { | ||
var currentDate = new Date(); | ||
|
||
return format(new Date(Date.UTC( | ||
currentDate.getFullYear(), | ||
currentDate.getMonth(), | ||
currentDate.getDate(), | ||
currentDate.getHours(), | ||
currentDate.getMinutes(), | ||
currentDate.getSeconds() | ||
))); | ||
}; |
Oops, something went wrong.