Date
class Date extends DateTime
JDate is a class that stores a date and provides logic to manipulate and render that date in a variety of formats.
Constants
DAY_ABBR |
|
DAY_NAME |
|
MONTH_ABBR |
|
MONTH_NAME |
|
Properties
static string | $format | The format string to be applied when using the __toString() magic method. |
Methods
Constructor.
Magic method to access properties of the date given by class to the format method.
Magic method to render the date object in the format specified in the public static member Date::$format.
Proxy for new JDate().
Translates day of week number to a string.
Gets the date as a formatted string in a local calendar.
Gets the date as a formatted string.
Get the time offset from GMT in hours or seconds.
Translates month number to a string.
Method to wrap the setTimezone() function and set the internal time zone object.
Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format and it can be found at the IETF Web site.
Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition can be found at the IETF Web site.
Gets the date as UNIX time stamp.
Adds an amount of days, months, years, hours, minutes and seconds to a JDate object.
Subtracts an amount of days, months, years, hours, minutes and seconds from a JDate object.
Alter the timestamp of this object by incre/decre-menting in a format accepted by strtotime().
Details
mixed
__get(
string $name)
Magic method to access properties of the date given by class to the format method.
string
__toString()
Magic method to render the date object in the format specified in the public static member Date::$format.
string
calendar(
string $format,
boolean $local = false,
boolean $translate = true)
Gets the date as a formatted string in a local calendar.
string
format(
string $format,
boolean $local = false,
boolean $translate = true)
Gets the date as a formatted string.
Date
setTimezone(
DateTimeZone $tz)
Method to wrap the setTimezone() function and set the internal time zone object.
string
toISO8601(
boolean $local = false)
Gets the date as an ISO 8601 string. IETF RFC 3339 defines the ISO 8601 format and it can be found at the IETF Web site.
string
toSql(
boolean $local = false,
JDatabaseDriver $db = null)
Gets the date as an SQL datetime string.
string
toRFC822(
boolean $local = false)
Gets the date as an RFC 822 string. IETF RFC 2822 supercedes RFC 822 and its definition can be found at the IETF Web site.
Date|bool
add(
DateInterval $interval)
Adds an amount of days, months, years, hours, minutes and seconds to a JDate object.