Utility to manipulate dates and convert date format
| package |
jelix |
|---|---|
| subpackage |
utils |
__construct( $year, $month, $day, $hour, $minute, $second)
_check() : boolean
booleantrue if the date/time are valid.
_createDateFromFormat(string $lf, \timestamp $str) : boolean
| link |
|---|
stringDate string format
\timestampThe timestamp to parse
booleanfalse if the string $str has a bad format
add(\jDuration/int $year, integer $month, integer $day, integer $hour, integer $minute, integer $second)
You can specify the duration in a jDuration object or give each value of the duration.
\jDuration/intthe duration value or a year with 4 digits
integermonth with 2 digits
integerday with 2 digits
integerhour with 2 digits
integerminute with 2 digits
integersecond with 2 digits
compareTo(\jDateTime $dt) : integer
integer-1 if $dt > $this, 0 if $dt = $this, 1 if $dt < $this
durationTo(\jDateTime $dt, boolean $absolute = true) : \jDuration
isNull() : boolean
| author |
Hadrien Lanneau (hadrien at over-blog dot com) |
|---|---|
boolean
now()
setFromString(string $str, integer $format = -1) : boolean
| see | \jDateTime:$defaultFormat |
|---|
stringthe string date
integerone of the class constant xxx_FORMAT, or -1 if it should use the default format
booleantrue if the format of $str has been parsed well
sub(\jDuration/int $year, integer $month, integer $day, integer $hour, integer $minute, integer $second)
\jDuration/intthe duration value or a year with 4 digits
integermonth with 2 digits
integerday with 2 digits
integerhour with 2 digits
integerminute with 2 digits
integersecond with 2 digits
substract(\jDateTime $date = null) : \jDateTime
| author |
Hadrien Lanneau hadrien@over-blog.com |
|---|---|
| since | 1.2 |
\jDateTime
\jDateTime
toString(integer $format = -1) : string
| see | \jDateTime:$defaultFormat |
|---|
integerone of the class constant xxx_FORMAT, or -1 if it should use the default format
stringthe string date
LANG_DFORMAT
LANG_DTFORMAT
LANG_TFORMAT
LANG_SHORT_DTFORMAT
LANG_SHORT_TFORMAT
DB_DFORMAT
DB_DTFORMAT
DB_TFORMAT
ISO8601_FORMAT
TIMESTAMP_FORMAT
RFC822_FORMAT
RFC2822_FORMAT
FULL_LANG_DATE
day :
month :
year :
hour :
minute :
second :
defaultFormat :