Class jDateTime

Description

Utility to manipulate dates and convert date format

  • todo: PHP53 : replace the use of strptime by date_parse_from_format

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


	
			
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 78)
  • access: public
mixed $defaultFormat = 11 (line 85)
  • access: public
mixed $hour (line 81)
  • access: public
mixed $minute (line 82)
  • access: public
mixed $month (line 79)
  • access: public
mixed $second (line 83)
  • access: public
mixed $year (line 80)
  • access: public
Methods
add (line 392)

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

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 103)
jDateTime __construct ( $year,  $month,  $day,  $hour,  $minute,  $second)
  • $year
  • $month
  • $day
  • $hour
  • $minute
  • $second
durationTo (line 441)

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

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

set date to current datetime

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

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

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

Substract a date with another

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

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

Documentation generated on Mon, 19 Sep 2011 14:12:24 +0200 by phpDocumentor 1.4.3