Class DateTimeValue

Description

Single date time value. This class provides some handy methods for working with timestamps and extracting data from them

  • version: 1.0

Located in /environment/classes/datetimevalue/DateTimeValue.class.php (line 10)


	
			
Method Summary
DateTimeValue __construct (integer $timestamp)
void advance (void $input, [boolean $mutate = true])
DateTime beginningOfDay (void 0)
null endOfDay (void 0)
string format (string $format)
integer getDay (void 0)
integer getHour (void 0)
integer getMinute (void 0)
integer getMonth (void 0)
integer getSecond (void 0)
integer getTimestamp (null 0)
integer getYear (void 0)
boolean isToday (void 0)
boolean isYesterday (void 0)
null setDay (integer $value)
null setHour (integer $value)
null setMinute (integer $value)
null setMonth (integer $value)
null setSecond (integer $value)
null setYear (integer $value)
string toAtom (void 0)
string toICalendar (void 0)
string toISO8601 (void 0)
string toMySQL (void 0)
string toRSS (void 0)
Methods
Constructor __construct (line 67)

Construct the DateTimeValue

DateTimeValue __construct (integer $timestamp)
  • integer $timestamp
advance (line 79)

Advance for specific time

  • throws: InvalidParamError
void advance (void $input, [boolean $mutate = true])
  • void $input
  • boolean $mutate: If true update this timestamp, else reutnr new object and dont touch internal timestamp
beginningOfDay (line 126)

This function will move interlan data to the beginning of day and return modified object.

It can be called as:

$beggining = DateTimeValueLib::now()->beginningOfDay()

  • access: public
DateTime beginningOfDay (void 0)
  • void 0
endOfDay (line 144)

This function will set hours, minutes and seconds to 23:59:59 and return this object.

If you wish to get end of this day simply type:

$end = DateTimeValueLib::now()->endOfDay()

  • access: public
null endOfDay (void 0)
  • void 0
format (line 161)

Return formated datetime

string format (string $format)
  • string $format
getDay (line 328)

Return days

integer getDay (void 0)
  • void 0
getHour (line 349)

Return hour

integer getHour (void 0)
  • void 0
getMinute (line 370)

Return minute

integer getMinute (void 0)
  • void 0
getMonth (line 307)

Return numberic representation of month

integer getMonth (void 0)
  • void 0
getSecond (line 391)

Return seconds

integer getSecond (void 0)
  • void 0
getTimestamp (line 265)

Get timestamp

integer getTimestamp (null 0)
  • null 0
getYear (line 286)

Return year

integer getYear (void 0)
  • void 0
isToday (line 96)

This function will return true if this day is today

boolean isToday (void 0)
  • void 0
isYesterday (line 109)

This function will return true if this datetime is yesterday

boolean isYesterday (void 0)
  • void 0
setDay (line 338)

Set day value

null setDay (integer $value)
  • integer $value
setHour (line 359)

Set hour value

null setHour (integer $value)
  • integer $value
setMinute (line 380)

Set minutes value

null setMinute (integer $value)
  • integer $value
setMonth (line 317)

Set month value

null setMonth (integer $value)
  • integer $value
setSecond (line 401)

Set seconds

null setSecond (integer $value)
  • integer $value
setYear (line 296)

Set year value

null setYear (integer $value)
  • integer $value
toAtom (line 191)

Return atom formated time (W3C format)

string toAtom (void 0)
  • void 0
toICalendar (line 211)

Return iCalendar formated date and time

string toICalendar (void 0)
  • void 0
toISO8601 (line 181)

Return ISO8601 formated time

string toISO8601 (void 0)
  • void 0
toMySQL (line 171)

Return datetime formated in MySQL datetime format

string toMySQL (void 0)
  • void 0
toRSS (line 201)

Return RSS format

string toRSS (void 0)
  • void 0

Documentation generated on Wed, 23 Jan 2008 01:58:34 +0000 by phpDocumentor 1.4.0