Class jDateTime

Description

Utility to manipulate dates and convert date format

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


	
			
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 (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])
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])
string toString ([int $format = -1])
Variables
mixed $day (line 75)
  • access: public
mixed $defaultFormat = 11 (line 82)
  • access: public
mixed $hour (line 78)
  • access: public
mixed $minute (line 79)
  • access: public
mixed $month (line 76)
  • access: public
mixed $second (line 80)
  • access: public
mixed $year (line 77)
  • access: public
Methods
Constructor __construct (line 107)
jDateTime __construct ( $year,  $month,  $day,  $hour,  $minute,  $second)
  • $year
  • $month
  • $day
  • $hour
  • $minute
  • $second
add (line 363)

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

compare two date

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

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
now (line 451)

set date to current datetime

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

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

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
toString (line 150)

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

use DB_* consts instead

  • deprecated:
BD_DTFORMAT = 21 (line 100)

use DB_* consts instead

  • deprecated:
BD_TFORMAT = 22 (line 101)

use DB_* consts instead

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

Documentation generated on Thu, 22 Mar 2012 22:15:12 +0100 by phpDocumentor 1.4.3