PHP Classes

File: sample.php

Recommend this page to a friend!
  Classes of Ingvar Stepanyan   Localized Date/Time Strings   sample.php   Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Simple example
Class: Localized Date/Time Strings
Manipulate time and dates based on a given locale
Author: By
Last change: Fixed sample
Date: 14 years ago
Size: 382 bytes
 

Contents

Class file image Download
<?php
header
('Content-Type: text/plain');
require
'LocalTime.class.php';

$LocalTime = new LocalTime('deu');
$LocalTime->addOwnDict(array(
'heute' => 'today',
'morgen' => 'tomorrow'
// , ...
));
echo
date('l', $LocalTime->strtotime('+1 Montag 15.10.2010')), PHP_EOL; // outputs "Monday"
echo $LocalTime->date('l', strtotime('15.10.2010')), PHP_EOL; // outputs "Freitag"