I18N
[ class tree: I18N ] [ index: I18N ] [ all elements ]

Class: I18N_DateTime

Source Location: /I18N-1.0.0/DateTime.php

Class Overview

PEAR
   |
   --I18N_Format
      |
      --I18N_DateTime



Variables

Methods


Inherited Variables

Inherited Methods

Class: I18N_Format

I18N_Format::I18N_Format()
I18N_Format::getFormat()
I18N_Format::setFormat()
define a custom format given by $format and return the $format-id the format-id can be used to call format( x , format-id ) to tell the method you want to use the format with that id

Class Details

[line 35]


[ Top ]


Class Variables

$days = array( 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' )

[line 49]


Type:   mixed


[ Top ]

$daysAbbreviated = array( 'Sun','Mon','Tue','Wed','Thu','Fri','Sat')

[line 51]


Type:   mixed


[ Top ]

$months = array(
                            'January',
                            'February',
                            'March',
                            'April',
                            'May',
                            'June',
                            'July',
                            'August',
                            'September',
                            'October',
                            'November',
                            'December'
                         )

[line 55]


Type:   mixed


[ Top ]

$monthsAbbreviated = array( 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' ,'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' )

[line 53]


Type:   mixed


[ Top ]

$_locale =

[line 76]

this var contains the current locale this instace works with
  • Var: this is a string like 'de_DE' or 'en_US', etc.
  • Access: protected

Type:   string
Overrides:   Array


[ Top ]

$_localeObj =  null

[line 84]

the locale object which contains all the formatting specs
  • Access: protected

Type:   object
Overrides:   Array


[ Top ]



Method Detail

format   [line 125]

string format( [int $timestamp = null], [int $format = null])

returns the timestamp formatted according to the locale and the format-mode use this method to format a date and time timestamp

Parameters:

int   $timestamp     a timestamp
int   $format     the formatting mode, using setFormat you can add custom formats

[ Top ]

formatDate   [line 142]

string formatDate( [int $timestamp = null], [int $format = null])

returns the timestamp formatted according to the locale and the format-mode use this method to get a formatted date only

Parameters:

int   $timestamp     a timestamp
int   $format     the formatting mode, use setDateFormat to add custom formats

[ Top ]

formatDateDefault   [line 501]

string formatDateDefault( [int $timestamp = null])

convinience method, same as formatDate( $timestamp , I18N_DATETIME_DEFAULT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_DEFAULT


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatDateFull   [line 555]

string formatDateFull( [int $timestamp = null])

convinience method, same as formatDate( $timestamp , I18N_DATETIME_FULL )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_FULL


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatDateLong   [line 537]

string formatDateLong( [int $timestamp = null])

convinience method, same as formatDate( $timestamp , I18N_DATETIME_LONG )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_LONG


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatDateMedium   [line 519]

string formatDateMedium( [int $timestamp = null])

convinience method, same as formatDate( $timestamp , I18N_DATETIME_MEDIUM )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_MEDIUM


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatDateShort   [line 483]

string formatDateShort( [int $timestamp = null])

convinience method, same as formatDate( $timestamp , I18N_DATETIME_SHORT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_SHORT


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatDefault   [line 408]

string formatDefault( [int $timestamp = null])

convinience method, same as format( $timestamp , I18N_DATETIME_DEFAULT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_DEFAULT


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatFull   [line 462]

string formatFull( [int $timestamp = null])

convinience method, same as format( $timestamp , I18N_DATETIME_FULL )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_FULL


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatLong   [line 444]

string formatLong( [int $timestamp = null])

convinience method, same as format( $timestamp , I18N_DATETIME_LONG )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_LONG


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatMedium   [line 426]

string formatMedium( [int $timestamp = null])

convinience method, same as format( $timestamp , I18N_DATETIME_MEDIUM )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_MEDIUM


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatShort   [line 390]

string formatShort( [int $timestamp = null])

convinience method, same as format( $timestamp , I18N_DATETIME_SHORT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_SHORT


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatTime   [line 159]

string formatTime( [int $timestamp = null], [int $format = null])

returns the timestamp formatted according to the locale and the format-mode use this method to get a formatted time only

Parameters:

int   $timestamp     a timestamp
int   $format     the formatting mode, use setTimeFormat to add custom formats

[ Top ]

formatTimeDefault   [line 595]

string formatTimeDefault( [int $timestamp = null])

convinience method, same as formatTime( $timestamp , I18N_DATETIME_DEFAULT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_DEFAULT


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatTimeFull   [line 649]

string formatTimeFull( [int $timestamp = null])

convinience method, same as formatTime( $timestamp , I18N_DATETIME_FULL )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_FULL


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatTimeLong   [line 631]

string formatTimeLong( [int $timestamp = null])

convinience method, same as formatTime( $timestamp , I18N_DATETIME_LONG )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_LONG


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatTimeMedium   [line 613]

string formatTimeMedium( [int $timestamp = null])

convinience method, same as formatTime( $timestamp , I18N_DATETIME_MEDIUM )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_MEDIUM


Parameters:

int   $timestamp     a timestamp

[ Top ]

formatTimeShort   [line 577]

string formatTimeShort( [int $timestamp = null])

convinience method, same as formatTime( $timestamp , I18N_DATETIME_SHORT )

this method exists, to have a shorter call to the method with a default format I18N_DATETIME_SHORT


Parameters:

int   $timestamp     a timestamp

[ Top ]

getDateFormat   [line 326]

void getDateFormat( )


[ Top ]

getDayNames   [line 361]

void getDayNames( [ $abbreviated = false])


Parameters:

   $abbreviated     

[ Top ]

getMonthName   [line 339]

void getMonthName( [ $which = null], [ $abbreviated = false])

get either the current or the given month name

Parameters:

   $which     
   $abbreviated     

[ Top ]

getMonthNames   [line 355]

void getMonthNames( [ $abbreviated = false])

get all month names for the current locale

get all month names for the current locale, fallback to english if not defined


Parameters:

   $abbreviated     

[ Top ]

getTimeFormat   [line 330]

void getTimeFormat( )


[ Top ]

setDateFormat   [line 302]

int setDateFormat( [string $format = I18N_DATETIME_DEFAULT])

define a custom format given by $format and return the $format-id the format-id can be used to call formatDate( x , format-id ) to tell the method you want to use the format with that id

Parameters:

string   $format     defines a custom format

[ Top ]

setFormat   [line 286]

int setFormat( [string $format = I18N_DATETIME_DEFAULT])

define a custom format given by $format and return the $format-id the format-id can be used to call format( x , format-id ) to tell the method you want to use the format with that id

Overrides I18N_Format::setFormat() (define a custom format given by $format and return the $format-id the format-id can be used to call format( x , format-id ) to tell the method you want to use the format with that id)

Parameters:

string   $format     defines a custom format

[ Top ]

setTimeFormat   [line 318]

int setTimeFormat( [string $format = I18N_DATETIME_DEFAULT])

define a custom format given by $format and return the $format-id the format-id can be used to call formatTime( x , format-id ) to tell the method you want to use the format with that id

Parameters:

string   $format     defines a custom format

[ Top ]

singleton   [line 108]

object an &singleton( [string $locale = null])

Use this method to setup and to retreive the static instance of the I18N_DateTime.

  1.    // setup the object with the proper locale
  2.    I18N_DateTime::singleton($locale);
  3.    // and anywhere in your code you can call the following
  4.    // and you get the instance for this very locale, you specified via singleton()
  5.    $dateTime I18N_DateTime::singleton();

  • Return: instance of this class
  • Access: public

Parameters:

string   $locale     the locale to use, i.e. 'de_DE'

[ Top ]


Documentation generated on Sat, 13 Feb 2010 19:30:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.