Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitDateTimeFormatter

Core::arbitDateTimeFormatter

Class arbitDateTimeFormatter

Locale dependent date time formatter

Locale dependent date time formatter

Author(s):
Version:   $Revision: 1236 $
License:   GPL

Member Variables

protected string $locale
Currently set locale

Currently set locale

protected mixed $localeData
Locale data for date time formatting

Locale data for date time formatting

Method Summary

public void __construct( $locale )
COnstruct formatter from two character locale abreviation
public string format( $format , $time )
Format date Format date given as a PHP DateTime object, which already includes time and timezon information.
protected void loadLocaleData( $locale )
Load locale data Try to load locale data. arbitUnknownLocaleException is thrown.
public string patternFormat( $pattern , $time )
Pattern based date formatting Return a date formatted based on the given patter. specified by the pattern are replaced by their language specific form, but the pattern is not modified for the current locale.
protected string tokenToValue( $token , $time )
Convert pattern token to value

Methods

__construct

void __construct( string $locale )

COnstruct formatter from two character locale abreviation

COnstruct formatter from two character locale abreviation

Parameters:
Name Type Description
$locale string

format

string format( string $format , $time )

Format date Format date given as a PHP DateTime object, which already includes time and timezon information.

Format date Format date given as a PHP DateTime object, which already includes time and timezon information. The format string may be one of:

  • full, long, medium, short
For a combined date and time string
  • fullDate, longDate, mediumDate, shortDate
For a date only without time specification
  • fullTime, longTime, mediumTime, shortTime
For a time only, without date specification The method returns a formatted date, depending on set locale.

Parameters:
Name Type Description
$format string
$time DateTime

loadLocaleData

void loadLocaleData( string $locale )

Load locale data Try to load locale data. arbitUnknownLocaleException is thrown.

Load locale data Try to load locale data. If no data is available for the given locale a arbitUnknownLocaleException is thrown.

Parameters:
Name Type Description
$locale string

patternFormat

string patternFormat( string $pattern , $time )

Pattern based date formatting Return a date formatted based on the given patter. specified by the pattern are replaced by their language specific form, but the pattern is not modified for the current locale.

Pattern based date formatting Return a date formatted based on the given patter. Textual names specified by the pattern are replaced by their language specific form, but the pattern is not modified for the current locale.

Parameters:
Name Type Description
$pattern string
$time DateTime

tokenToValue

string tokenToValue( string $token , $time )

Convert pattern token to value

Convert pattern token to value Convert a pattern token into the value depending on the given DateTime object

Parameters:
Name Type Description
$token string
$time DateTime
Documentation generated on Mon, 05 Apr 2010 14:01:47 +0200 by phpDocumentor 1.4.3