Method Summary
-
string
format()
Formats a date according to the pattern.
-
string
getAMPM(, )
Get the AM/PM designator, 12 noon is PM, 12 midnight is AM.
-
array
getDate(, )
Guesses a date without calling strtotime.
-
int
getDayInMonth(, )
Gets day in the month.
-
string
getEra(, )
Gets the era. i.e. in gregorian, year > 0 is AD, else BC.
-
mixed
getFunctionName()
For a particular token, get the corresponding function to call.
-
string
getHour12(, )
Gets the hours in 12 hour format.
-
int
getHourInAMPM(, )
Gets the hours in AM/PM format, e.g [1-12]
-
int
getHourInDay(, )
Gets the hours [1-24].
-
string
getHours(, )
Gets the hours in 24 hour format, i.e. [0-23].
-
string
getInputPattern()
Returns an easy to parse input pattern
-
string
getMday(, )
Gets the day of the month.
-
string
getMinutes(, )
Gets the minutes.
-
string
getMon(, )
Gets the month.
-
string
getPattern()
Gets the pattern from DateTimeFormatInfo or some predefined patterns.
-
string
getSeconds(, )
Gets the seconds.
-
string
getTimeZone(, )
Gets the timezone from the server machine.
-
array
getTokens()
Tokenizes the pattern. The tokens are delimited by group of
-
getUnixDate()
-
string
getWday(, )
Gets the day of the week.
-
int
getWeekInMonth()
Gets week in the month.
-
int
getWeekInYear(, )
Gets the week in the year.
-
int
getYday(, )
Gets the day in the year, e.g. [1-366]
-
string
getYear(, )
Gets the year.
-
sfDateFormat
__construct()
Initializes a new sfDateFormat.
Method Details
-
Formats a date according to the pattern.
returns formatted date time.
-
Get the AM/PM designator, 12 noon is PM, 12 midnight is AM.
returns AM or PM designator
-
Guesses a date without calling strtotime.
returns same array as the getdate function
-
(int) getDayInMonth (, )
Browse code
Gets day in the month.
returns day in month
-
Gets the era. i.e. in gregorian, year > 0 is AD, else BC.
returns era
-
(mixed) getFunctionName ()
Browse code
For a particular token, get the corresponding function to call.
returns the function if good token, null otherwise.
-
(string) getHour12 (, )
Browse code
Gets the hours in 12 hour format.
"h" for non-padding, "hh" will always return 2 characters.
returns hours in 12 hour format.
-
(int) getHourInAMPM (, )
Browse code
Gets the hours in AM/PM format, e.g [1-12]
returns hours in AM/PM format.
-
(int) getHourInDay (, )
Browse code
Gets the hours [1-24].
returns hours [1-24]
-
(string) getHours (, )
Browse code
Gets the hours in 24 hour format, i.e. [0-23].
"H" for non-padding, "HH" will always return 2 characters.
returns hours in 24 hour format.
-
(string) getInputPattern ()
Browse code
Returns an easy to parse input pattern
yy is replaced by yyyy and h by H
returns input pattern
-
Gets the day of the month.
"d" for non-padding, "dd" will always return 2 characters.
returns day of the month
-
(string) getMinutes (, )
Browse code
Gets the minutes.
"m" for non-padding, "mm" will always return 2 characters.
returns minutes.
-
Gets 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"
returns month name
-
(string) getPattern ()
Browse code
Gets 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.
returns a pattern.
-
(string) getSeconds (, )
Browse code
Gets the seconds.
"s" for non-padding, "ss" will always return 2 characters.
returns seconds
-
(string) getTimeZone (, )
Browse code
Gets the timezone from the server machine.
returns time zone
-
Tokenizes 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.
returns string tokens in an array.
-
-
Gets 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"
returns day of the week.
-
(int) getWeekInMonth ()
Browse code
Gets week in the month.
returns week in month
-
(int) getWeekInYear (, )
Browse code
Gets the week in the year.
returns week in year
-
Gets the day in the year, e.g. [1-366]
returns hours in AM/PM format.
-
Gets the year.
"yy" will return the last two digits of year.
"yyyy" will return the full integer year.
returns year
-
(sfDateFormat) __construct ()
Browse code
Initializes a new sfDateFormat.
returns instance
|