constructor
OCSP_DATE
OCSP_DATE
([
boolean $setNow =
True])
-
boolean
$setNow: (if true the current timestamp is set to the object
add $sec seconds to the date
void
add
(int $sec)
add $days days to the date
void
addDays
( $days, int $sec, since 1)
-
int
$sec
-
since
1: pk-05-04-07
-
$days
returns the date as string with format $aFormat for $aFormat see http://at.php.net/manual/en/function.date.php
string
dateStr
([string $aFormat = "r"], [boolean $debug = False])
-
string
$aFormat
-
boolean
$debug
calculates the difference between two dates returns the rounded granularity between $this and a Date
granularity values are:
- s seconds
- i minutes
- h hours
- d days
- m month
- y year
int
diff
(pcf_DATE $aDate, [char $granularity = 's'], [char $round = 0], [boolean $debug = False])
-
pcf_DATE
$aDate
-
char
$granularity
-
char
$round
-
boolean
$debug
returns if to date objectes have the same date;
returns the day (of month [1..31])
int
getDay
()
void
getDayNameShort
([ $dayNr = -1], [ $lang = "DE"])
returns the day of the week (0 Sunday,1 Monday,....6 Saturday)
taken from: http://www.terra.es/personal2/grimmer/
int
getDayOfWeek
()
calculate the first monday of year due to ISO8601 and returns the linux timestamp of it
double
getFirstMondayOfYear
()
void
getLinuxTimeStamp
()
returns the month as integer (1..12)
int
getMonth
(boolean $with2Digets)
-
boolean
$with2Digets: add leading zero?
returns the ISO-8601 week number of the week of the 1st day of a month
int
getMonthFirstWeekNr
()
void
getMonthName
([ $aMonth = 0], [ $lang = "DE"])
returns a short monthname (4 letters or 3 letter and dot)
string
getMonthNameShort
()
returns the days of the current month
int
getMonthNofDays
()
void
getMySqlTimeStamp
()
Numeric representation of the day of the weekday
- (for Sunday) through 6 (for Saturday)
int
getWeekDay
()
returns the ISO-8601 week number
int
getWeekNr
()
returns the year as integer (4 digets)
int
getYear
()
* ical methods
void
iCalDecoder
( $file)
returns if the current date is a holiday
array
isHoliday
([string $country = "AT"])
checks if the current date is in futur
boolean
isInFutur
()
checks if the current date is in past
boolean
isInPast
()
returns if $this->myYear is a leap year (feb 29 days)
boolean
isLeapYear
()
returns if the Date is null
NOTE: if year is 0 and day or month lower 1 the date is considered as null
boolean
isNULL
()
returns if the day is a workday or not returns True for Monday - Friday returns False for Saturday, Sunday and holidays
boolean
isWorkDay
()
sets the date from a date string with yyyy-MM-dd [HH:mm:ss] format
void
setDateStr
(string $aString, [boolean $debug = False])
-
string
$aString
-
boolean
$debug: since pk-05-03-30
sets the day
void
setDay
( $aDay, int $aMonth)
sets the date from a db string
boolean
setDbString
(string $dbValue, [boolean $debug = False])
-
string
$dbValue
-
boolean
$debug
sets the date from an array with at least YEAR set if $dataArray is not an array or $dateArray['YEAR'] is not set the object is set to null and False is returned
boolean
setFromArray
( $dateArray, [boolean $debug = False], array $dataArray)
-
array
$dataArray
-
boolean
$debug
-
$dateArray
sets the date to a linux timestamp
boolean
setLinuxTime
([ $aTime = 0])
void
setLinuxTimeStamp
([ $aTime = 0])
sets to the Monday 00:00:00 of the current week
void
setMonday
()
sets to the Monday in week (ISO8601)
void
setMondayOfWeek
(int $week, [int $year = 0])
sets the month
void
setMonth
(int $aMonth)
sets the current date out of a mysql timestamp value
void
setMySqlTimeStamp
(string $mysql_timestamp)
-
string
$mysql_timestamp: (YYYYMMDDHHMMSS)
void
setTimeStr
( $aString)
sets the year as integer (4 digets)
void
setYear
(int $aYear)
subtract $sec seconds from the date
void
subtract
(int $sec)
subtract $days from the date
void
subtractDays
( $days, int $sec)