Mecha CMS

Mecha CMS blog and documentation.

Common Date Format

Table of Contents
  1. Usage 

Common date formats used by the web system.

define('DATE_ATOM', 'Y-m-d\TH:i:sP'); // 2020-08-12T04:21:23+07:00
define('DATE_COOKIE', 'l, d-M-y H:i:s \U\T\C'); // Wednesday, 12-Aug-20 04:21:23 UTC
define('DATE_ISO8601', 'c'); // 2020-08-12T04:21:23+07:00
define('DATE_RFC822', 'D, d M y H:i:s O'); // Wed, 12 Aug 20 04:21:23 +0700
define('DATE_RFC850', 'l, d-M-y H:i:s \U\T\C'); // Wednesday, 12-Aug-20 04:21:23 UTC
define('DATE_RFC1036', 'D, d M y H:i:s O'); // Wed, 12 Aug 20 04:21:23 +0700
define('DATE_RFC1123', 'D, d M Y H:i:s O'); // Wed, 12 Aug 2020 04:21:23 +0700
define('DATE_RFC2822', 'D, d M Y H:i:s O'); // Wed, 12 Aug 2020 04:21:23 +0700
define('DATE_RSS', 'D, d M Y H:i:s O'); // Wed, 12 Aug 2020 04:21:23 +0700
define('DATE_W3C', 'c'); // 2020-08-12T04:21:23+07:00

Usage 

echo $page->time->format(DATE_COOKIE);

0 Comments

No comments yet.