Annotation of embedaddon/php/ext/date/tests/DateTime_getOffset_basic1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test DateTime::getOffset() function : basic functionality
3: --FILE--
4: <?php
5: /* Prototype : public int DateTime::getOffset ( void )
6: * Description: Returns the daylight saving time offset
7: * Source code: ext/date/php_date.c
8: * Alias to functions: date_offset_get
9: */
10:
11: //Set the default time zone
12: date_default_timezone_set('Europe/London');
13:
14: echo "*** Testing DateTime::getOffset() : basic functionality ***\n";
15:
16: $winter = new DateTime('2008-12-25 14:25:41');
17: $summer = new DateTime('2008-07-02 14:25:41');
18:
19: echo "Winter offset: " . $winter->getOffset() / 3600 . " hours\n";
20: echo "Summer offset: " . $summer->getOffset() / 3600 . " hours\n";
21:
22: ?>
23: ===DONE===
24: --EXPECTF--
25: *** Testing DateTime::getOffset() : basic functionality ***
26: Winter offset: 0 hours
27: Summer offset: 1 hours
28: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>