[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorLocalTimeTestCase extends PhabricatorTestCase { 4 5 public function testLocalTimeFormatting() { 6 $user = new PhabricatorUser(); 7 $user->setTimezoneIdentifier('America/Los_Angeles'); 8 9 $utc = new PhabricatorUser(); 10 $utc->setTimezoneIdentifier('UTC'); 11 12 $this->assertEqual( 13 'Jan 1 2000, 12:00 AM', 14 phabricator_datetime(946684800, $utc), 15 'Datetime formatting'); 16 $this->assertEqual( 17 'Jan 1 2000', 18 phabricator_date(946684800, $utc), 19 'Date formatting'); 20 $this->assertEqual( 21 '12:00 AM', 22 phabricator_time(946684800, $utc), 23 'Time formatting'); 24 25 $this->assertEqual( 26 'Dec 31 1999, 4:00 PM', 27 phabricator_datetime(946684800, $user), 28 'Localization'); 29 30 $this->assertEqual( 31 '', 32 phabricator_datetime(0, $user), 33 'Missing epoch should fail gracefully'); 34 } 35 36 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |