1.0.7 • Published 1 year ago

php-date-format v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

php-date-format

NPM

A node.js package for PHP style format date.

  • No dependencies package
  • Support escape

Installation

npm install php-date-format

Usage

var format = require('php-date-format');
// defaults to ISO8601 format and current date
format();
// output: 2024-01-03T15:04:13.020+09:00

// time
format('H:i:s.v', new Date('2024-01-13T15:04:13.02+09:00'));
// output: 15:04:13.020

// week dates
format('Y-\\WW-N');
// ouptut: 2024-W01-3

// RFC 2822 / RFC 5322 formatted date
format('r');
format('D, d M Y H:i:s O');
// output: Wed, 03 Jan 2024 15:04:13 +0900

Formats

Should support most PHP date formats, see https://www.php.net/manual/en/datetime.format.php

Note

  • Only support local time
  • Timezone format (O, P, p) returns local tz (process.env.TZ)
  • Timezone abbreviation (T) does not support. Returns UTC or GMT+0900
1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.0

1 year ago