Class jDateTime

Description

Utility to manipulate dates and convert date format

Located in /utils/jDateTime.class.php (line 33)


	
			
Class Constant Summary
Variable Summary
mixed $day
mixed $hour
mixed $minute
mixed $month
mixed $second
mixed $year
Method Summary
void add (jDuration/int $year, [int $month = 0], [int $day = 0], [int $hour = 0], [int $minute = 0], [int $second = 0])
integer compareTo (jDateTime $dt)
jDateTime __construct ([ $year = 0], [ $month = 0], [ $day = 0], [ $hour = 0], [ $minute = 0], [ $second = 0])
jDuration durationTo (jDateTime $dt, [bool $absolute = true])
boolean isNull ()
void now ()
void setFromString (string $str, [int $format = -1])
void sub (jDuration/int $year, [int $month = 0], [int $day = 0], [int $hour = 0], [int $minute = 0], [int $second = 0])
jDateTime substract ([jDateTime $date = null])
string toString ([int $format = -1])
Variables
mixed $day (line 34)
  • access: public
mixed $defaultFormat = 11 (line 41)
  • access: public
mixed $hour (line 37)
  • access: public
mixed $minute (line 38)
  • access: public
mixed $month (line 35)
  • access: public
mixed $second (line 39)
  • access: public
mixed $year (line 36)
  • access: public
Methods
add (line 337)

Add a duration to the date.

You can specify the duration in a jDuration object or give each value of the duration.

  • access: public
void add (jDuration/int $year, int $month, int $day, int $hour, int $minute, int $second)
  • jDuration/int $year: the duration value or a year with 4 digits
  • int $month: month with 2 digits
  • int $day: day with 2 digits
  • int $hour: hour with 2 digits
  • int $minute: minute with 2 digits
  • int $second: second with 2 digits
compareTo (line 411)

Compare two date

  • return: -1 if $dt > $this, 0 if $dt = $this, 1 if $dt < $this
  • access: public
integer compareTo (jDateTime $dt)
Constructor __construct (line 60)
jDateTime __construct ( $year,  $month,  $day,  $hour,  $minute,  $second)
  • $year
  • $month
  • $day
  • $hour
  • $minute
  • $second
durationTo (line 386)

to know the duration between two dates.

  • return: a jDuration object
  • access: public
jDuration durationTo (jDateTime $dt, [bool $absolute = true])
  • jDateTime $dt: the date on which a sub will be made with the date on the current object
  • bool $absolute
isNull (line 103)

Check if jDateTime is "null" (all values egals to 0)

  • author: Hadrien Lanneau (hadrien at over-blog dot com)
  • access: public
boolean isNull ()
now (line 425)

Set date to current datetime

  • access: public
void now ()
setFromString (line 189)

read a string to extract date values

  • see: jDateTime:$defaultFormat
void setFromString (string $str, [int $format = -1])
  • string $str: the string date
  • int $format: one of the class constant xxx_FORMAT, or -1 if it should use the default format
sub (line 368)

substract a duration to the date You can specify the duration in a jDuration object or give each value of the duration.

  • access: public
void sub (jDuration/int $year, int $month, int $day, int $hour, int $minute, int $second)
  • jDuration/int $year: the duration value or a year with 4 digits
  • int $month: month with 2 digits
  • int $day: day with 2 digits
  • int $hour: hour with 2 digits
  • int $minute: minute with 2 digits
  • int $second: second with 2 digits
substract (line 442)

Substract a date with another

jDateTime substract ([jDateTime $date = null])
toString (line 113)

Convert the date to a string format

  • return: the string date
  • see: jDateTime:$defaultFormat
string toString ([int $format = -1])
  • int $format: one of the class constant xxx_FORMAT, or -1 if it should use the default format
Class Constants
DB_DFORMAT = 20 (line 48)
DB_DTFORMAT = 21 (line 49)
DB_TFORMAT = 22 (line 50)
FULL_LANG_DATE = 62 (line 55)
ISO8601_FORMAT = 40 (line 51)
LANG_DFORMAT = 10 (line 43)
LANG_DTFORMAT = 11 (line 44)
LANG_SHORT_DTFORMAT = 13 (line 46)
LANG_SHORT_TFORMAT = 14 (line 47)
LANG_TFORMAT = 12 (line 45)
RFC822_FORMAT = 60 (line 53)
RFC2822_FORMAT = 61 (line 54)
TIMESTAMP_FORMAT = 50 (line 52)

Documentation generated on Wed, 04 Jan 2017 22:53:39 +0100 by phpDocumentor 1.4.3