- Added missing slides for time presentation

This commit is contained in:
Derick Rethans
2006-04-22 10:24:54 +00:00
parent 497f37e0e4
commit 4649a5d430
4 changed files with 52 additions and 0 deletions

View 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>

View 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
View 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>

View File

@@ -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 -->