PHP Classes

File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   Lego PHP   Library/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test   Download  
File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/functions/date.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lego PHP
Blog and shopping cart system
Author: By
Last change:
Date: 7 years ago
Size: 895 bytes
 

Contents

Class file image Download
--TEST-- "date" function --TEMPLATE-- {{ date() == date('now') ? 'OK' : 'KO' }} {{ date(date1) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date2) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} --DATA-- date_default_timezone_set('UTC'); return array( 'date1' => mktime(13, 45, 0, 10, 4, 2010), 'date2' => new DateTime('2010-10-04 13:45'), 'date3' => '2010-10-04 13:45', 'date4' => 1286199900, // DateTime::createFromFormat('Y-m-d H:i', '2010-10-04 13:45', new DateTimeZone('UTC'))->getTimestamp() -- A unixtimestamp is always GMT 'date5' => -189291360, // DateTime::createFromFormat('Y-m-d H:i', '1964-01-02 03:04', new DateTimeZone('UTC'))->getTimestamp(), ) --EXPECT-- OK OK OK OK OK OK