[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/I18N/core/ -> DateFormat.php (sommaire)

DateFormat class file. This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.

Author: Wei Zhuo
Version: $Revision: 1.8 $ $Date: 2005/12/15 07:14:49 $
Poids: 652 lignes (17 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

DateFormat:: (22 méthodes):
  __construct()
  format()
  getFunctionName()
  getPattern()
  getTokens()
  getYear()
  getMonth()
  getDayInWeek()
  getDay()
  getEra()
  getHour24()
  getAMPM()
  getHour12()
  getMinutes()
  getSeconds()
  getTimeZone()
  getDayInYear()
  getDayInMonth()
  getWeekInYear()
  getWeekInMonth()
  getHourInDay()
  getHourInAMPM()


Classe: DateFormat  - X-Ref

DateFormat class.

The DateFormat class allows you to format dates and times with
predefined styles in a locale-sensitive manner. Formatting times
with the DateFormat class is similar to formatting dates.

Formatting dates with the DateFormat class is a two-step process.
First, you create a formatter with the getDateInstance method.
Second, you invoke the format method, which returns a string containing
the formatted date.

DateTime values are formatted using standard or custom patterns stored
in the properties of a DateTimeFormatInfo.

__construct($formatInfo=null)   X-Ref
Initialize a new DateFormat.

param: mixed either, null, a CultureInfo instance,
return: DateFormat instance

format($time, $pattern='F', $charset='UTF-8')   X-Ref
Format a date according to the pattern.

param: mixed the time as integer or string in strtotime format.
return: string formatted date time.

getFunctionName($token)   X-Ref
For a particular token, get the corresponding function to call.

param: string token
return: mixed the function if good token, null otherwise.

getPattern($pattern)   X-Ref
Get the pattern from DateTimeFormatInfo or some predefined patterns.
If the $pattern parameter is an array of 2 element, it will assume
that the first element is the date, and second the time
and try to find an appropriate pattern and apply
DateTimeFormatInfo::formatDateTime
See the tutorial documentation for futher details on the patterns.

param: mixed a pattern.
return: string a pattern.

getTokens($pattern)   X-Ref
Tokenize the pattern. The tokens are delimited by group of
similar characters, e.g. 'aabb' will form 2 tokens of 'aa' and 'bb'.
Any substrings, starting and ending with a single quote (')
will be treated as a single token.

param: string pattern.
return: array string tokens in an array.

getYear($date, $pattern='yyyy')   X-Ref
Get the year.
"yy" will return the last two digits of year.
"yyyy" will return the full integer year.

param: array getdate format.
param: string a pattern.
return: string year

getMonth($date, $pattern='M')   X-Ref
Get the month.
"M" will return integer 1 through 12
"MM" will return the narrow month name, e.g. "J"
"MMM" will return the abrreviated month name, e.g. "Jan"
"MMMM" will return the month name, e.g. "January"

param: array getdate format.
param: string a pattern.
return: string month name

getDayInWeek($date, $pattern='EEEE')   X-Ref
Get the day of the week.
"E" will return integer 0 (for Sunday) through 6 (for Saturday).
"EE" will return the narrow day of the week, e.g. "M"
"EEE" will return the abrreviated day of the week, e.g. "Mon"
"EEEE" will return the day of the week, e.g. "Monday"

param: array getdate format.
param: string a pattern.
return: string day of the week.

getDay($date, $pattern='d')   X-Ref
Get the day of the month.
"d" for non-padding, "dd" will always return 2 characters.

param: array getdate format.
param: string a pattern.
return: string day of the month

getEra($date, $pattern='G')   X-Ref
Get the era. i.e. in gregorian, year > 0 is AD, else BC.

param: array getdate format.
param: string a pattern.
return: string era

getHour24($date, $pattern='H')   X-Ref
Get the hours in 24 hour format, i.e. [0-23].
"H" for non-padding, "HH" will always return 2 characters.

param: array getdate format.
param: string a pattern.
return: string hours in 24 hour format.

getAMPM($date, $pattern='a')   X-Ref
Get the AM/PM designator, 12 noon is PM, 12 midnight is AM.

param: array getdate format.
param: string a pattern.
return: string AM or PM designator

getHour12($date, $pattern='h')   X-Ref
Get the hours in 12 hour format.
"h" for non-padding, "hh" will always return 2 characters.

param: array getdate format.
param: string a pattern.
return: string hours in 12 hour format.

getMinutes($date, $pattern='m')   X-Ref
Get the minutes.
"m" for non-padding, "mm" will always return 2 characters.

param: array getdate format.
param: string a pattern.
return: string minutes.

getSeconds($date, $pattern='s')   X-Ref
Get the seconds.
"s" for non-padding, "ss" will always return 2 characters.

param: array getdate format.
param: string a pattern.
return: string seconds

getTimeZone($date, $pattern='z')   X-Ref
Get the timezone from the server machine.

param: array getdate format.
param: string a pattern.
return: string time zone

getDayInYear($date, $pattern='D')   X-Ref
Get the day in the year, e.g. [1-366]

param: array getdate format.
param: string a pattern.
return: int hours in AM/PM format.

getDayInMonth($date, $pattern='FF')   X-Ref
Get day in the month.

param: array getdate format.
param: string a pattern.
return: int day in month

getWeekInYear($date, $pattern='w')   X-Ref
Get the week in the year.

param: array getdate format.
param: string a pattern.
return: int week in year

getWeekInMonth($date, $pattern='W')   X-Ref
Get week in the month.

param: array getdate format.
return: int week in month

getHourInDay($date, $pattern='k')   X-Ref
Get the hours [1-24].

param: array getdate format.
param: string a pattern.
return: int hours [1-24]

getHourInAMPM($date, $pattern='K')   X-Ref
Get the hours in AM/PM format, e.g [1-12]

param: array getdate format.
param: string a pattern.
return: int hours in AM/PM format.



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7