cvs: presentations / time-ffm2006.xml /slides/time basic-parse-time-new.xml date-modify.xml date-modify2.xml improvements-formats.xml
improvements-more-on-timezones.xml improvements-overview.xml improvements-timezones-which-to-use.xml improvements-timezones.xml sun-up-down.xml
timezone-figuring-out-next-dst-change.xml timezone-object-1.xml timezone-object-2.xml timezone-tips.xml timezone-utilities-1.xml when.xml
| From: | Derick Rethans | Date: | Thu, 02 Nov 2006 12:22:23 +0000 |
| Subject: | cvs: presentations / time-ffm2006.xml /slides/time basic-parse-time-new.xml date-modify.xml date-modify2.xml improvements-formats.xml improvements-more-on-timezones.xml improvements-overview.xml improvements-timezones-which-to-use.xml improvements-timezones.xml sun-up-down.xml timezone-figuring-out-next-dst-change.xml timezone-object-1.xml timezone-object-2.xml timezone-tips.xml timezone-utilities-1.xml when.xml |
||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1353@lists.php.net to get a copy of this message | ||
derick Thu Nov 2 12:22:23 2006 UTC
Added files:
/presentations time-ffm2006.xml
/presentations/slides/time date-modify2.xml
improvements-more-on-timezones.xml
improvements-timezones-which-to-use.xml
timezone-figuring-out-next-dst-change.xml
Modified files:
/presentations/slides/time basic-parse-time-new.xml date-modify.xml
improvements-formats.xml
improvements-overview.xml
improvements-timezones.xml
sun-up-down.xml timezone-object-1.xml
timezone-object-2.xml timezone-tips.xml
timezone-utilities-1.xml when.xml
Log:
- Added date/time talk for Frankfurt.
http://cvs.php.net/viewvc.cgi/presentations/slides/time/basic-parse-time-new.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/basic-parse-time-new.xml diff -u presentations/slides/time/basic-parse-time-new.xml:1.2 presentations/slides/time/basic-parse-time-new.xml:1.3 --- presentations/slides/time/basic-parse-time-new.xml:1.2 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/basic-parse-time-new.xml Thu Nov 2 12:22:22 2006 @@ -8,8 +8,14 @@ ?>]]></example> <break/> + <blurb>Alternatively you can just instantiate a DateTime object:</blurb> + <example><![CDATA[<?php + $ts = new DateTime("2006-11-07 16:12:15"); +?>]]></example> +<break/> + <blurb>This function will not return the timestamp as an integer, but - instead returns a Date object which is a wrapper around a 64 bit + instead returns a DateTime object which is a wrapper around a 64 bit integer (with some additional functionality ofcourse).</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/date-modify.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/date-modify.xml diff -u presentations/slides/time/date-modify.xml:1.1 presentations/slides/time/date-modify.xml:1.2 --- presentations/slides/time/date-modify.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/date-modify.xml Thu Nov 2 12:22:22 2006 @@ -5,13 +5,13 @@ <blurb>Modifying dates and times:</blurb> <example result="1"><![CDATA[<?php date_default_timezone_set("Europe/Oslo"); - $ts = date_create("now"); + $ts = new DateTime("now"); echo $ts->format(DATE_RFC2822), "<br/>\n"; echo $ts->modify("+2 days"); echo $ts->format(DATE_RFC2822), "<br/>\n"; - echo $ts->modify("third month"); + echo $ts->modify("fifth month"); echo $ts->format(DATE_RFC2822), "<br/>\n"; echo $ts->modify("Friday +3 weeks"); http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-formats.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/improvements-formats.xml diff -u presentations/slides/time/improvements-formats.xml:1.1 presentations/slides/time/improvements-formats.xml:1.2 --- presentations/slides/time/improvements-formats.xml:1.1 Wed Jun 8 13:49:55 2005 +++ presentations/slides/time/improvements-formats.xml Thu Nov 2 12:22:22 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>String Formats</subtitle> <blurb>"American" formats:</blurb> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-overview.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/improvements-overview.xml diff -u presentations/slides/time/improvements-overview.xml:1.2 presentations/slides/time/improvements-overview.xml:1.3 --- presentations/slides/time/improvements-overview.xml:1.2 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/improvements-overview.xml Thu Nov 2 12:22:22 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>Improvements</subtitle> <list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-timezones.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/time/improvements-timezones.xml diff -u presentations/slides/time/improvements-timezones.xml:1.3 presentations/slides/time/improvements-timezones.xml:1.4 --- presentations/slides/time/improvements-timezones.xml:1.3 Thu Mar 30 17:07:16 2006 +++ presentations/slides/time/improvements-timezones.xml Thu Nov 2 12:22:22 2006 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>Timezone Support</subtitle> <list> - <bullet>Bundled timezone database with 538 zones</bullet> + <bullet>Bundled timezone database with 546 zones</bullet> <bullet>Not dependent on timezone abbreviations</bullet> <bullet>Timezones have the format: Continent/Location or Continent/Location/Sublocation - Like: Europe/Amsterdam, America/Indiana/Knox</bullet> </list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/sun-up-down.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/sun-up-down.xml diff -u presentations/slides/time/sun-up-down.xml:1.2 presentations/slides/time/sun-up-down.xml:1.3 --- presentations/slides/time/sun-up-down.xml:1.2 Sun Apr 23 15:08:00 2006 +++ presentations/slides/time/sun-up-down.xml Thu Nov 2 12:22:22 2006 @@ -12,8 +12,8 @@ $lat = $info['lat']; $lon = $info['lon']; $info = date_sun_info(time(), $lon, $lat); - echo "Sunrise is at ", date(date::RSS, $info['sunrise']), "\n"; - echo "Sunset is at ", date(date::RSS, $info['sunset']), "\n"; + echo "Sunrise is at ", date(DateTime::RSS, $info['sunrise']), "\n"; + echo "Sunset is at ", date(DateTime::RSS, $info['sunset']), "\n"; echo "Day length is ", round(($info['sunset'] - $info['sunrise']) / 3600, 1), "hrs"; } http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-object-1.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-object-1.xml diff -u presentations/slides/time/timezone-object-1.xml:1.1 presentations/slides/time/timezone-object-1.xml:1.2 --- presentations/slides/time/timezone-object-1.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-object-1.xml Thu Nov 2 12:22:22 2006 @@ -17,9 +17,10 @@ <break lines="3"/> <blurb>A passed timezone object does not override a *parsed* timezone:</blurb> - <example><![CDATA[<?php - $tz = timezone_open("Pacific/Honolulu"); - $ts1 = date_create("1978-12-22 09:15 CET", $tz); - $ts2 = date_create("1978-12-22 09:15 Europe/Amsterdam", $tz); + <example result="1"><![CDATA[<?php + $tz = new DateTimeZone("Pacific/Honolulu"); + $ts1 = new DateTime("1978-12-22 09:15 CET", $tz); + $ts2 = new DateTime("1978-12-22 09:15 Europe/Amsterdam", $tz); + echo $ts2->format( DateTime::RFC2822 ); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-object-2.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-object-2.xml diff -u presentations/slides/time/timezone-object-2.xml:1.1 presentations/slides/time/timezone-object-2.xml:1.2 --- presentations/slides/time/timezone-object-2.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-object-2.xml Thu Nov 2 12:22:22 2006 @@ -9,15 +9,15 @@ echo timezone_name_get($tz), ', '; $tz = timezone_open("CEST"); - echo $tz->getName(); + echo timezone_name_get($tz); ?>]]></example> <break lines="2"/> <blurb>Getting the current offset to GMT with a timezone for a specific date:</blurb> <example result="1"><![CDATA[<?php - $tz = timezone_open("Europe/Amsterdam"); - $d = date_create("2005-01-22 09:15"); - echo timezone_offset_get($tz, $d), ', '; + $tz = new DateTimeZone("Europe/Amsterdam"); + $d = new DateTime("2005-01-22 09:15"); + echo $tz->getOffset($d), ', '; $d->modify("+6 months"); echo $tz->getOffset($d); ?>]]></example> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-tips.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-tips.xml diff -u presentations/slides/time/timezone-tips.xml:1.1 presentations/slides/time/timezone-tips.xml:1.2 --- presentations/slides/time/timezone-tips.xml:1.1 Thu Mar 30 17:07:16 2006 +++ presentations/slides/time/timezone-tips.xml Thu Nov 2 12:22:22 2006 @@ -3,7 +3,7 @@ <title>Timezone and Date tips</title> <list> - <bullet>Store date/time in a timezone agnostic way: GMT</bullet> + <bullet>Store date/time in a timezone agnostic way: UTC</bullet> <bullet>Use a "Unix" timestamp, perhaps as string: %date("U");%</bullet> </list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-utilities-1.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-utilities-1.xml diff -u presentations/slides/time/timezone-utilities-1.xml:1.1 presentations/slides/time/timezone-utilities-1.xml:1.2 --- presentations/slides/time/timezone-utilities-1.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-utilities-1.xml Thu Nov 2 12:22:22 2006 @@ -6,8 +6,8 @@ <blurb>Creating a timezone resource:</blurb> <example result="1"><![CDATA[<?php $tz = timezone_open("Europe/Amsterdam"); - $trs = timezone_transistions_get($tz); - $trs = $tz->getTransistions(); + $trs = timezone_transitions_get($tz); + $trs = $tz->getTransitions(); echo "<pre>\n"; foreach ($trs as $tr) { http://cvs.php.net/viewvc.cgi/presentations/slides/time/when.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/when.xml diff -u presentations/slides/time/when.xml:1.1 presentations/slides/time/when.xml:1.2 --- presentations/slides/time/when.xml:1.1 Sat Apr 22 10:24:54 2006 +++ presentations/slides/time/when.xml Thu Nov 2 12:22:22 2006 @@ -2,11 +2,8 @@ <slide> <title>When Is The Additional Functionality Available</title> - <list> - <bullet>In PHP 5.1 if you compile PHP with a special flag</bullet> - <bullet>In PHP 5.2 by default</bullet> - </list> -<break/> - <blurb>Compile like:</blurb> + <blurb>In PHP 5.1 if you compile PHP with a special flag:</blurb> <example>CFLAGS=-DEXPERIMENTAL_DATE_SUPPORT=1 ./configure</example> +<break lines="2"/> + <blurb>In PHP 5.2 and higher by default.</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/time-ffm2006.xml?view=markup&rev=1.1 Index: presentations/time-ffm2006.xml +++ presentations/time-ffm2006.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Localization and Internationalization</topic> <title>Time = Money</title> <event>International PHP Conference</event> <location>Frankfurt, Germany</location> <date>November 7th, 2006</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/perf/title.xml</slide> <!-- INTRODUCTION --> <slide>slides/time/what-is-time2.xml</slide> <slide>slides/time/problems-string-representation.xml</slide> <slide>slides/time/problems-timezones.xml</slide> <slide>slides/time/problems-timezone-abbr.xml</slide> <slide>slides/time/problems-dst.xml</slide> <slide>slides/time/problems-dst2.xml</slide> <slide>slides/time/problems-dst3.xml</slide> <!-- PHP - CURRENT --> <slide>slides/time/current-functions.xml</slide> <slide>slides/time/current-limitations.xml</slide> <!-- PHP - IMPROVEMENTS --> <slide>slides/time/improvements-overview.xml</slide> <slide>slides/time/improvements-formats.xml</slide> <slide>slides/time/improvements-timezones.xml</slide> <slide>slides/time/improvements-timezones-which-to-use.xml</slide> <slide>slides/time/improvements-more-on-timezones.xml</slide> <!-- PHP - CODE EXAMPLES --> <slide>slides/time/basic-parse-time.xml</slide> <slide>slides/time/basic-parse-time-new.xml</slide> <slide>slides/time/date-parse.xml</slide> <!-- DATE EXAMPLES --> <slide>slides/time/date-format.xml</slide> <!-- <slide>slides/time/date-format-locale.xml</slide> --> <slide>slides/time/date-modify2.xml</slide> <slide>slides/time/date-modify.xml</slide> <slide>slides/time/basic-using-zones.xml</slide> <slide>slides/time/default-timezone.xml</slide> <slide>slides/time/timezone-object-1.xml</slide> <slide>slides/time/timezone-object-2.xml</slide> <slide>slides/time/date-timezone.xml</slide> <!-- set/get --> <slide>slides/time/timezone-utilities-1.xml</slide> <slide>slides/time/timezone-utilities-2.xml</slide> <slide>slides/time/timezone-figuring-out-next-dst-change.xml</slide> <!-- TIPS --> <slide>slides/time/timezone-tips.xml</slide> <slide>slides/time/sun-up-down.xml</slide> <slide>slides/time/user-timezone.xml</slide> <slide>slides/time/when.xml</slide> <!-- EXIT --> <slide>slides/time/resources.xml</slide> <!-- resources --> </presentation> http://cvs.php.net/viewvc.cgi/presentations/slides/time/date-modify2.xml?view=markup&rev=1.1 Index: presentations/slides/time/date-modify2.xml +++ presentations/slides/time/date-modify2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Updating Dates and Times</title> <example result="1"><![CDATA[<?php $date = new DateTime( 'now' ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setTime( 15, 0, 7 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setDate( 2006, 12, 22 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setIsoDate( 2006, 45, 2 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-more-on-timezones.xml?view=markup&rev=1.1 Index: presentations/slides/time/improvements-more-on-timezones.xml +++ presentations/slides/time/improvements-more-on-timezones.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Changing Timezone Definitions</title> <list> <bullet>An updated database is released about 20 times a year.</bullet> <bullet>Some of the changes are *very* sudden.</bullet> <bullet>PHP releases will therefore often have an outdated version.</bullet> <bullet>The PECL extension timezonedb provides a drop in replacement for the timezone database.</bullet> <bullet>%pecl install timezonedb%</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-timezones-which-to-use.xml?view=markup&rev=1.1 Index: presentations/slides/time/improvements-timezones-which-to-use.xml +++ presentations/slides/time/improvements-timezones-which-to-use.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Timezone Support</title> <subtitle>Which one to use</subtitle> <list> <bullet>Each zone is identified by the city with the largest population in a specific area.</bullet> <bullet>Zones are divided into 10 major groups: Africa, America, Antarctica, Artic, Asia, Atlantic, Europe, Indian, Pacific.</bullet> <bullet>Examples are: America/Toronto, Europe/Berlin, America/New_York, Europe/Oslo, Asia/Singapore.</bullet> <bullet>There is also a group "Others" which contains outdated and backwards compatible names, such as Canada/Eastern, Etc/GMT-1 and US/Central. Those should *not* be used.</bullet> <bullet>Pick the zone that is closest to your location.</bullet> <bullet>http://php.net/timezones</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-figuring-out-next-dst-change.xml?view=markup&rev=1.1 Index: presentations/slides/time/timezone-figuring-out-next-dst-change.xml +++ presentations/slides/time/timezone-figuring-out-next-dst-change.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Daylight Savings Time</title> <subtitle>When is the next change?</subtitle> <example result="1"><![CDATA[<?php $tz = new DateTimeZone( isset($_GET['zone']) ? $_GET['zone'] : "Europe/Amsterdam"); foreach (timezone_transitions_get($tz) as $tr) if ($tr['ts'] > time()) break; $d = new DateTime( "@{$tr['ts']}" ); printf("The timezone %s switches to %s on %s.<br/>The new GMT offset will be: %d (%s)\n", $tz->getName(), $tr['isdst'] ? "DST" : "standard time", $d->format('d M Y @ H:i'), $tr['offset'], $tr['abbr'] ); ?> <form> <select name='zone'> <?php foreach(DateTimeZone::listIdentifiers() as $id) { echo "<option value='$id'>$id</option>\n"; } ?> </select> <input type="submit" value="go"/> </form>]]></example> </slide>
http://cvs.php.net/viewvc.cgi/presentations/slides/time/basic-parse-time-new.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/basic-parse-time-new.xml diff -u presentations/slides/time/basic-parse-time-new.xml:1.2 presentations/slides/time/basic-parse-time-new.xml:1.3 --- presentations/slides/time/basic-parse-time-new.xml:1.2 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/basic-parse-time-new.xml Thu Nov 2 12:22:22 2006 @@ -8,8 +8,14 @@ ?>]]></example> <break/> + <blurb>Alternatively you can just instantiate a DateTime object:</blurb> + <example><![CDATA[<?php + $ts = new DateTime("2006-11-07 16:12:15"); +?>]]></example> +<break/> + <blurb>This function will not return the timestamp as an integer, but - instead returns a Date object which is a wrapper around a 64 bit + instead returns a DateTime object which is a wrapper around a 64 bit integer (with some additional functionality ofcourse).</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/date-modify.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/date-modify.xml diff -u presentations/slides/time/date-modify.xml:1.1 presentations/slides/time/date-modify.xml:1.2 --- presentations/slides/time/date-modify.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/date-modify.xml Thu Nov 2 12:22:22 2006 @@ -5,13 +5,13 @@ <blurb>Modifying dates and times:</blurb> <example result="1"><![CDATA[<?php date_default_timezone_set("Europe/Oslo"); - $ts = date_create("now"); + $ts = new DateTime("now"); echo $ts->format(DATE_RFC2822), "<br/>\n"; echo $ts->modify("+2 days"); echo $ts->format(DATE_RFC2822), "<br/>\n"; - echo $ts->modify("third month"); + echo $ts->modify("fifth month"); echo $ts->format(DATE_RFC2822), "<br/>\n"; echo $ts->modify("Friday +3 weeks"); http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-formats.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/improvements-formats.xml diff -u presentations/slides/time/improvements-formats.xml:1.1 presentations/slides/time/improvements-formats.xml:1.2 --- presentations/slides/time/improvements-formats.xml:1.1 Wed Jun 8 13:49:55 2005 +++ presentations/slides/time/improvements-formats.xml Thu Nov 2 12:22:22 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>String Formats</subtitle> <blurb>"American" formats:</blurb> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-overview.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/improvements-overview.xml diff -u presentations/slides/time/improvements-overview.xml:1.2 presentations/slides/time/improvements-overview.xml:1.3 --- presentations/slides/time/improvements-overview.xml:1.2 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/improvements-overview.xml Thu Nov 2 12:22:22 2006 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>Improvements</subtitle> <list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-timezones.xml?r1=1.3&r2=1.4&diff_format=u Index: presentations/slides/time/improvements-timezones.xml diff -u presentations/slides/time/improvements-timezones.xml:1.3 presentations/slides/time/improvements-timezones.xml:1.4 --- presentations/slides/time/improvements-timezones.xml:1.3 Thu Mar 30 17:07:16 2006 +++ presentations/slides/time/improvements-timezones.xml Thu Nov 2 12:22:22 2006 @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <slide> - <title>Date/Time Functions in PHP 5.1</title> + <title>Date/Time Functions in PHP 5.1 and up</title> <subtitle>Timezone Support</subtitle> <list> - <bullet>Bundled timezone database with 538 zones</bullet> + <bullet>Bundled timezone database with 546 zones</bullet> <bullet>Not dependent on timezone abbreviations</bullet> <bullet>Timezones have the format: Continent/Location or Continent/Location/Sublocation - Like: Europe/Amsterdam, America/Indiana/Knox</bullet> </list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/sun-up-down.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/time/sun-up-down.xml diff -u presentations/slides/time/sun-up-down.xml:1.2 presentations/slides/time/sun-up-down.xml:1.3 --- presentations/slides/time/sun-up-down.xml:1.2 Sun Apr 23 15:08:00 2006 +++ presentations/slides/time/sun-up-down.xml Thu Nov 2 12:22:22 2006 @@ -12,8 +12,8 @@ $lat = $info['lat']; $lon = $info['lon']; $info = date_sun_info(time(), $lon, $lat); - echo "Sunrise is at ", date(date::RSS, $info['sunrise']), "\n"; - echo "Sunset is at ", date(date::RSS, $info['sunset']), "\n"; + echo "Sunrise is at ", date(DateTime::RSS, $info['sunrise']), "\n"; + echo "Sunset is at ", date(DateTime::RSS, $info['sunset']), "\n"; echo "Day length is ", round(($info['sunset'] - $info['sunrise']) / 3600, 1), "hrs"; } http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-object-1.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-object-1.xml diff -u presentations/slides/time/timezone-object-1.xml:1.1 presentations/slides/time/timezone-object-1.xml:1.2 --- presentations/slides/time/timezone-object-1.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-object-1.xml Thu Nov 2 12:22:22 2006 @@ -17,9 +17,10 @@ <break lines="3"/> <blurb>A passed timezone object does not override a *parsed* timezone:</blurb> - <example><![CDATA[<?php - $tz = timezone_open("Pacific/Honolulu"); - $ts1 = date_create("1978-12-22 09:15 CET", $tz); - $ts2 = date_create("1978-12-22 09:15 Europe/Amsterdam", $tz); + <example result="1"><![CDATA[<?php + $tz = new DateTimeZone("Pacific/Honolulu"); + $ts1 = new DateTime("1978-12-22 09:15 CET", $tz); + $ts2 = new DateTime("1978-12-22 09:15 Europe/Amsterdam", $tz); + echo $ts2->format( DateTime::RFC2822 ); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-object-2.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-object-2.xml diff -u presentations/slides/time/timezone-object-2.xml:1.1 presentations/slides/time/timezone-object-2.xml:1.2 --- presentations/slides/time/timezone-object-2.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-object-2.xml Thu Nov 2 12:22:22 2006 @@ -9,15 +9,15 @@ echo timezone_name_get($tz), ', '; $tz = timezone_open("CEST"); - echo $tz->getName(); + echo timezone_name_get($tz); ?>]]></example> <break lines="2"/> <blurb>Getting the current offset to GMT with a timezone for a specific date:</blurb> <example result="1"><![CDATA[<?php - $tz = timezone_open("Europe/Amsterdam"); - $d = date_create("2005-01-22 09:15"); - echo timezone_offset_get($tz, $d), ', '; + $tz = new DateTimeZone("Europe/Amsterdam"); + $d = new DateTime("2005-01-22 09:15"); + echo $tz->getOffset($d), ', '; $d->modify("+6 months"); echo $tz->getOffset($d); ?>]]></example> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-tips.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-tips.xml diff -u presentations/slides/time/timezone-tips.xml:1.1 presentations/slides/time/timezone-tips.xml:1.2 --- presentations/slides/time/timezone-tips.xml:1.1 Thu Mar 30 17:07:16 2006 +++ presentations/slides/time/timezone-tips.xml Thu Nov 2 12:22:22 2006 @@ -3,7 +3,7 @@ <title>Timezone and Date tips</title> <list> - <bullet>Store date/time in a timezone agnostic way: GMT</bullet> + <bullet>Store date/time in a timezone agnostic way: UTC</bullet> <bullet>Use a "Unix" timestamp, perhaps as string: %date("U");%</bullet> </list> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-utilities-1.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/timezone-utilities-1.xml diff -u presentations/slides/time/timezone-utilities-1.xml:1.1 presentations/slides/time/timezone-utilities-1.xml:1.2 --- presentations/slides/time/timezone-utilities-1.xml:1.1 Fri Jul 22 08:47:29 2005 +++ presentations/slides/time/timezone-utilities-1.xml Thu Nov 2 12:22:22 2006 @@ -6,8 +6,8 @@ <blurb>Creating a timezone resource:</blurb> <example result="1"><![CDATA[<?php $tz = timezone_open("Europe/Amsterdam"); - $trs = timezone_transistions_get($tz); - $trs = $tz->getTransistions(); + $trs = timezone_transitions_get($tz); + $trs = $tz->getTransitions(); echo "<pre>\n"; foreach ($trs as $tr) { http://cvs.php.net/viewvc.cgi/presentations/slides/time/when.xml?r1=1.1&r2=1.2&diff_format=u Index: presentations/slides/time/when.xml diff -u presentations/slides/time/when.xml:1.1 presentations/slides/time/when.xml:1.2 --- presentations/slides/time/when.xml:1.1 Sat Apr 22 10:24:54 2006 +++ presentations/slides/time/when.xml Thu Nov 2 12:22:22 2006 @@ -2,11 +2,8 @@ <slide> <title>When Is The Additional Functionality Available</title> - <list> - <bullet>In PHP 5.1 if you compile PHP with a special flag</bullet> - <bullet>In PHP 5.2 by default</bullet> - </list> -<break/> - <blurb>Compile like:</blurb> + <blurb>In PHP 5.1 if you compile PHP with a special flag:</blurb> <example>CFLAGS=-DEXPERIMENTAL_DATE_SUPPORT=1 ./configure</example> +<break lines="2"/> + <blurb>In PHP 5.2 and higher by default.</blurb> </slide> http://cvs.php.net/viewvc.cgi/presentations/time-ffm2006.xml?view=markup&rev=1.1 Index: presentations/time-ffm2006.xml +++ presentations/time-ffm2006.xml <?xml version="1.0" encoding="iso-8859-1"?> <presentation template="css" navmode="html" navbarbackground="#4373b4" navbartopiclinks="0" navColor="#f1fbff" logo1="" stylesheet="presentations/slides/perf/ezp.css" backgroundfixed="1" > <topic>Localization and Internationalization</topic> <title>Time = Money</title> <event>International PHP Conference</event> <location>Frankfurt, Germany</location> <date>November 7th, 2006</date> <speaker>Derick Rethans</speaker> <email>dr@ez.no</email> <url>http://derickrethans.nl/talks.php</url> <slide>slides/perf/title.xml</slide> <!-- INTRODUCTION --> <slide>slides/time/what-is-time2.xml</slide> <slide>slides/time/problems-string-representation.xml</slide> <slide>slides/time/problems-timezones.xml</slide> <slide>slides/time/problems-timezone-abbr.xml</slide> <slide>slides/time/problems-dst.xml</slide> <slide>slides/time/problems-dst2.xml</slide> <slide>slides/time/problems-dst3.xml</slide> <!-- PHP - CURRENT --> <slide>slides/time/current-functions.xml</slide> <slide>slides/time/current-limitations.xml</slide> <!-- PHP - IMPROVEMENTS --> <slide>slides/time/improvements-overview.xml</slide> <slide>slides/time/improvements-formats.xml</slide> <slide>slides/time/improvements-timezones.xml</slide> <slide>slides/time/improvements-timezones-which-to-use.xml</slide> <slide>slides/time/improvements-more-on-timezones.xml</slide> <!-- PHP - CODE EXAMPLES --> <slide>slides/time/basic-parse-time.xml</slide> <slide>slides/time/basic-parse-time-new.xml</slide> <slide>slides/time/date-parse.xml</slide> <!-- DATE EXAMPLES --> <slide>slides/time/date-format.xml</slide> <!-- <slide>slides/time/date-format-locale.xml</slide> --> <slide>slides/time/date-modify2.xml</slide> <slide>slides/time/date-modify.xml</slide> <slide>slides/time/basic-using-zones.xml</slide> <slide>slides/time/default-timezone.xml</slide> <slide>slides/time/timezone-object-1.xml</slide> <slide>slides/time/timezone-object-2.xml</slide> <slide>slides/time/date-timezone.xml</slide> <!-- set/get --> <slide>slides/time/timezone-utilities-1.xml</slide> <slide>slides/time/timezone-utilities-2.xml</slide> <slide>slides/time/timezone-figuring-out-next-dst-change.xml</slide> <!-- TIPS --> <slide>slides/time/timezone-tips.xml</slide> <slide>slides/time/sun-up-down.xml</slide> <slide>slides/time/user-timezone.xml</slide> <slide>slides/time/when.xml</slide> <!-- EXIT --> <slide>slides/time/resources.xml</slide> <!-- resources --> </presentation> http://cvs.php.net/viewvc.cgi/presentations/slides/time/date-modify2.xml?view=markup&rev=1.1 Index: presentations/slides/time/date-modify2.xml +++ presentations/slides/time/date-modify2.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Updating Dates and Times</title> <example result="1"><![CDATA[<?php $date = new DateTime( 'now' ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setTime( 15, 0, 7 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setDate( 2006, 12, 22 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; $date->setIsoDate( 2006, 45, 2 ); echo $date->format(DateTime::ISO8601), "<br/>\n"; ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-more-on-timezones.xml?view=markup&rev=1.1 Index: presentations/slides/time/improvements-more-on-timezones.xml +++ presentations/slides/time/improvements-more-on-timezones.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Changing Timezone Definitions</title> <list> <bullet>An updated database is released about 20 times a year.</bullet> <bullet>Some of the changes are *very* sudden.</bullet> <bullet>PHP releases will therefore often have an outdated version.</bullet> <bullet>The PECL extension timezonedb provides a drop in replacement for the timezone database.</bullet> <bullet>%pecl install timezonedb%</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/improvements-timezones-which-to-use.xml?view=markup&rev=1.1 Index: presentations/slides/time/improvements-timezones-which-to-use.xml +++ presentations/slides/time/improvements-timezones-which-to-use.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Timezone Support</title> <subtitle>Which one to use</subtitle> <list> <bullet>Each zone is identified by the city with the largest population in a specific area.</bullet> <bullet>Zones are divided into 10 major groups: Africa, America, Antarctica, Artic, Asia, Atlantic, Europe, Indian, Pacific.</bullet> <bullet>Examples are: America/Toronto, Europe/Berlin, America/New_York, Europe/Oslo, Asia/Singapore.</bullet> <bullet>There is also a group "Others" which contains outdated and backwards compatible names, such as Canada/Eastern, Etc/GMT-1 and US/Central. Those should *not* be used.</bullet> <bullet>Pick the zone that is closest to your location.</bullet> <bullet>http://php.net/timezones</bullet> </list> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/time/timezone-figuring-out-next-dst-change.xml?view=markup&rev=1.1 Index: presentations/slides/time/timezone-figuring-out-next-dst-change.xml +++ presentations/slides/time/timezone-figuring-out-next-dst-change.xml <?xml version="1.0" encoding="ISO-8859-1"?> <slide> <title>Daylight Savings Time</title> <subtitle>When is the next change?</subtitle> <example result="1"><![CDATA[<?php $tz = new DateTimeZone( isset($_GET['zone']) ? $_GET['zone'] : "Europe/Amsterdam"); foreach (timezone_transitions_get($tz) as $tr) if ($tr['ts'] > time()) break; $d = new DateTime( "@{$tr['ts']}" ); printf("The timezone %s switches to %s on %s.<br/>The new GMT offset will be: %d (%s)\n", $tz->getName(), $tr['isdst'] ? "DST" : "standard time", $d->format('d M Y @ H:i'), $tr['offset'], $tr['abbr'] ); ?> <form> <select name='zone'> <?php foreach(DateTimeZone::listIdentifiers() as $id) { echo "<option value='$id'>$id</option>\n"; } ?> </select> <input type="submit" value="go"/> </form>]]></example> </slide>