date-time

WebJar for date-time

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

date-time
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

date-time
WebJar for date-time
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/date-time

Download date-time

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/date-time/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>date-time</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/date-time/
implementation 'org.webjars.npm:date-time:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/date-time/
implementation ("org.webjars.npm:date-time:2.1.0")
'org.webjars.npm:date-time:jar:2.1.0'
<dependency org="org.webjars.npm" name="date-time" rev="2.1.0">
  <artifact name="date-time" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='date-time', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "date-time" % "2.1.0"
[org.webjars.npm/date-time "2.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : time-zone jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

date-time

Pretty datetime: 2014-01-09 06:46:01

Install

$ npm install date-time

Usage

const dateTime = require('date-time');

dateTime();
//=> '2017-05-20 17:07:05'

dateTime({date: new Date(1989, 2, 4, 10)});
//=> '1989-03-04 09:00:00'

dateTime({showTimeZone: true});
//=> '2017-05-20 17:07:05 UTC+7'

dateTime({local: false});
//=> '2017-05-20 10:07:05'

dateTime({local: false, showTimeZone: true});
//=> '2017-05-20 10:07:05 UTC'

dateTime({showMilliseconds: true});
//=> '2017-05-20 17:07:05 6ms'

API

dateTime(options?)

options

Type: object

date

Type: Date
Default: new Date()

Custom date.

local

Type: boolean
Default: true

Show the date in the local time zone.

showTimeZone

Type: boolean
Default: false

Show the UTC time zone postfix.

showMilliseconds

Type: boolean
Default: false

Show the milliseconds in the date if any.

Versions

Version
2.1.0