Class jDateTime

Description

Utility to manipulate dates and convert date format

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


	
			
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)
jDuration durationTo (jDateTime $dt, [bool $absolute = true])
boolean isNull ()
void now ()
jDateTime __construct ([ $year = 0], [ $month = 0], [ $day = 0], [ $hour = 0], [ $minute = 0], [ $second = 0])
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 77)
  • access: public
mixed $defaultFormat = 11 (line 84)
  • access: public
mixed $hour (line 80)
  • access: public
mixed $minute (line 81)
  • access: public
mixed $month (line 78)
  • access: public
mixed $second (line 82)
  • access: public
mixed $year (line 79)
  • access: public
Methods
add (line 374)

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 448)

compare two date

  • return: -1 if $dt > $this, 0 if $dt = $this, 1 if $dt < $this
  • access: public
integer compareTo (jDateTime $dt)
durationTo (line 423)

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 144)

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 462)

set date to current datetime

  • access: public
void now ()
Constructor __construct (line 101)
jDateTime __construct ( $year,  $month,  $day,  $hour,  $minute,  $second)
  • $year
  • $month
  • $day
  • $hour
  • $minute
  • $second
setFromString (line 217)

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 405)

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 479)

Substract a date with another

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

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 89)
DB_DTFORMAT = 21 (line 90)
DB_TFORMAT = 22 (line 91)
FULL_LANG_DATE = 62 (line 96)
ISO8601_FORMAT = 40 (line 92)
LANG_DFORMAT = 10 (line 86)
LANG_DTFORMAT = 11 (line 87)
LANG_TFORMAT = 12 (line 88)
RFC822_FORMAT = 60 (line 94)
RFC2822_FORMAT = 61 (line 95)
TIMESTAMP_FORMAT = 50 (line 93)

Documentation generated on Thu, 19 Sep 2013 00:03:51 +0200 by phpDocumentor 1.4.3