mirror of
https://github.com/php/presentations.git
synced 2026-03-23 23:22:22 +01:00
- Added missing slides for time presentation
This commit is contained in:
16
slides/time/date-format-locale.xml
Normal file
16
slides/time/date-format-locale.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<slide>
|
||||
<title>Formatting Dates - Locale Aware</title>
|
||||
<subtitle>Locales with PHP 6</subtitle>
|
||||
|
||||
<example result="1"><![CDATA[<?php
|
||||
date_default_timezone_set("Europe/Oslo");
|
||||
$ts = date_create("December 22nd, 2005 15:41");
|
||||
|
||||
$locales = array('en_US', 'fr_CA', 'nb_NO', 'ru_RU', 'ar_SA', 'ja_JP');
|
||||
foreach ($locales as $locale) {
|
||||
i18n_loc_set_default($locale);
|
||||
echo date_format_locale($ts, DATE_RFC1036), "<br/>\n";
|
||||
}
|
||||
?>]]></example>
|
||||
</slide>
|
||||
21
slides/time/sun-up-down.xml
Normal file
21
slides/time/sun-up-down.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<slide>
|
||||
<title>Sunset/Sunrise</title>
|
||||
|
||||
<example result="1"><![CDATA[<?php
|
||||
date_default_timezone_set('America/Montreal');
|
||||
if (isset($_POST['country'])) {
|
||||
$client = new SoapClient('http://geo.derickrethans.nl/geo.wsdl');
|
||||
$info = $client->Location($_POST['country'], $_POST['city']);
|
||||
$lat = $info['lat']; $lon = $info['lon'];
|
||||
$info = date_sun_info(time(), $lon, $lat);
|
||||
echo "Sunrise is at ", date(date::ATOM, $info['sunrise']), "<br/>";
|
||||
echo "Sunset is at ", date(date::RSS, $info['sunset']), "<br/><hr/>";
|
||||
}
|
||||
?>
|
||||
<form method="post">
|
||||
Country: <input name="country"/> City: <input name="city"/><br/>
|
||||
<input type="submit" value="Check"/>
|
||||
</form>
|
||||
]]></example>
|
||||
</slide>
|
||||
12
slides/time/when.xml
Normal file
12
slides/time/when.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<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>
|
||||
<example>CFLAGS=-DEXPERIMENTAL_DATE_SUPPORT=1 ./configure</example>
|
||||
</slide>
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
<!-- DATE EXAMPLES -->
|
||||
<slide>slides/time/date-format.xml</slide>
|
||||
<slide>slides/time/date-format-locale.xml</slide>
|
||||
<slide>slides/time/date-modify.xml</slide>
|
||||
<slide>slides/time/basic-using-zones.xml</slide>
|
||||
<slide>slides/time/default-timezone.xml</slide>
|
||||
@@ -55,6 +56,8 @@
|
||||
|
||||
<!-- TIPS -->
|
||||
<slide>slides/time/timezone-tips.xml</slide>
|
||||
<slide>slides/time/sun-up-down.xml</slide>
|
||||
<slide>slides/time/when.xml</slide>
|
||||
|
||||
<!-- EXIT -->
|
||||
<slide>slides/time/resources.xml</slide> <!-- resources -->
|
||||
|
||||
Reference in New Issue
Block a user