Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2010-10-21 06:21
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"