Class jDateTime

Description

Utility to manipulate dates and convert date format

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


	
			
Class Constant Summary
Variable Summary
mixed $day
mixed $hour
mixed $minute
mixed $month
mixed $second
mixed $year
Method Summary
jDateTime __construct ([ $year = 0], [ $month = 0], [ $day = 0], [ $hour = 0], [ $minute = 0], [ $second = 0])
void add (jDateTime/int $year, [int $month = 0], [int $day = 0], [int $hour = 0], [int $minute = 0], [int $second = 0])
integer compareTo (jDateTime $dt)
void now ()
void setFromString (string $str, [int $format = -1])
void sub (jDateTime/int $year, [int $month = 0], [int $day = 0], [int $hour = 0], [int $minute = 0], [int $second = 0])
string toString ([int $format = -1])
Variables
mixed $day (line 71)
  • access: public
mixed $defaultFormat = 11 (line 78)
  • access: public
mixed $hour (line 74)
  • access: public
mixed $minute (line 75)
  • access: public
mixed $month (line 72)
  • access: public
mixed $second (line 76)
  • access: public
mixed $year (line 73)
  • access: public
Methods
Constructor __construct (line 103)
jDateTime __construct ( $year,  $month,  $day,  $hour,  $minute,  $second)
  • $year
  • $month
  • $day
  • $hour
  • $minute
  • $second
add (line 359)

Add a duration to the date.

You can specify the duration in a jDateTime object (which then is not a date/time) or give each value of the duration

  • access: public
void add (jDateTime/int $year, int $month, int $day, int $hour, int $minute, int $second)
  • jDateTime/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 423)

compare two date

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

to know the duration between two dates.

  • return: a jDateTime object which will contains a duration (not a date)
  • access: public
jDateTime durationTo (jDateTime $dt)
  • jDateTime $dt: the date on which a sub will be made with the date on the current object
now (line 437)

set date to current datetime

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

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

substract a duration to the date

You can specify the duration in a jDateTime object (which then is not a date/time) or give each value of the duration

  • access: public
void sub (jDateTime/int $year, int $month, int $day, int $hour, int $minute, int $second)
  • jDateTime/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
toString (line 146)

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
BD_DFORMAT = 20 (line 95)

use DB_* consts instead

  • deprecated:
BD_DTFORMAT = 21 (line 96)

use DB_* consts instead

  • deprecated:
BD_TFORMAT = 22 (line 97)

use DB_* consts instead

  • deprecated:
DB_DFORMAT = 20 (line 83)
DB_DTFORMAT = 21 (line 84)
DB_TFORMAT = 22 (line 85)
ISO8601_FORMAT = 40 (line 86)
LANG_DFORMAT = 10 (line 80)
LANG_DTFORMAT = 11 (line 81)
LANG_TFORMAT = 12 (line 82)
RFC822_FORMAT = 60 (line 88)
RFC2822_FORMAT = 61 (line 89)
TIMESTAMP_FORMAT = 50 (line 87)

Documentation generated on Wed, 07 Sep 2011 13:47:10 +0200 by phpDocumentor 1.4.3