Zap Calendar Date Helper Class
Helper class for various date functions
Methods |
public static addDate(int $date, int $hour, int $min, int $sec, int $month, int $day, int $year, string $tzid = 'UTC') Date math: add or substract from current date to get a new date
|
public static DayInMonth(int $month, int $year) : int Find the number of days in a month
|
public static DTNow(string $tzid) : DateTime Return now as DateTime
|
public static fromiCaltoUnixDateTime(string $datetime) : int Format iCal date-time string to Unix timestamp
|
public static fromSqlDateTime(?string $datetime = NULL) : string fromSqlDateTime() Take SQL timestamp and format to iCal date/time string
|
public static fromUnixDate(?int $datetime = NULL) : string Take Unix timestamp and format to iCal date string
|
public static fromUnixDateTime(?int $datetime = NULL) : string Take Unix timestamp and format to iCal date/time string
|
public static fromUnixDateTimetoiCal(int $datetime) : string Format Unix timestamp to iCal date-time string
|
public static getAbsDate(string $date, string $rdate = '') : string Convert from a relative date to an absolute date Examples of relative dates are '-2y' for 2 years ago, '18m' for 18 months after today. Relative date uses 'y', 'm' and 'd' for year, month and day. Relative date can be combined into comma separated list, i.e., '-1y,-1d' for 1 year and 1 day ago.
|
public static getDateFromDay(int $date, int $week, int $wday, string $tzid = 'UTC') : int Date math: get date from week and day in specific month This routine finds actual dates for the second Tuesday of the month, last Friday of the month, etc. For second Tuesday, use $week = 1, $wday = 2 for last Friday, use $week = -1, $wday = 5
|
public static iCalDurationtoSeconds(string $duration) : int Convert iCal duration string to # of seconds
|
public static inDay(int $daystart, int $begin, int $end) : bool Check if day falls within date range
|
public static isAfterToday(int $date, string $tzid = 'UTC') : bool Is given date after today?
|
public static isBeforeToday(int $date, string $tzid = 'UTC') : bool Is given date before today?
|
public static isFuture(int $date, string $tzid = 'UTC') : bool Is given date in the future? This routine differs from isAfterToday() in that isFuture() will return true for date-time values later in the same day.
|
public static isPast(int $date, string $tzid = 'UTC') : bool Is given date in the past? This routine differs from isBeforeToday() in that isPast() will return true for date-time values earlier in the same day.
|
public static isToday(int $date, string $tzid = 'UTC') : bool Is given date today?
|
public static isTomorrow(int $date, string $tzid = 'UTC') : bool Is given date tomorrow?
|
public static isWeekend(int $date) : bool Is given date fall on a weekend?
|
public static now(string $tzid = 'UTC') : int Return current Unix timestamp in local timezone
|
public static toiCalDate(?int $datetime = NULL) : string Format Unix timestamp to iCal date format
|
public static toiCalDateTime(?int $datetime = NULL) : string Format Unix timestamp to iCal date-time format
|
public static toLocalDateTime(string $sqldate, string $tzid = 'UTC') : string Convert UTC date-time to local date-time
|
public static toSQLDate(int $t = 0) : string Format Unix timestamp to SQL date
|
public static toSQLDateTime(int $t = 0) : string Format Unix timestamp to SQL date-time
|
public static toUnixDate(string $datetime) : int Convert SQL date or date-time to Unix timestamp
|
public static toUnixDateTime(string $datetime) : int Convert SQL date or date-time to Unix date timestamp
|
public static toUTCDateTime(string $sqldate, string $tzid = 'UTC') : string Convert local date-time to UTC date-time
|
Methods |
public static addDate(int $date, int $hour, int $min, int $sec, int $month, int $day, int $year, string $tzid = 'UTC') Date math: add or substract from current date to get a new date
|
public static DayInMonth(int $month, int $year) : int Find the number of days in a month
|
public static DTNow(string $tzid) : DateTime Return now as DateTime
|
public static fromiCaltoUnixDateTime(string $datetime) : int Format iCal date-time string to Unix timestamp
|
public static fromSqlDateTime(?string $datetime = NULL) : string fromSqlDateTime() Take SQL timestamp and format to iCal date/time string
|
public static fromUnixDate(?int $datetime = NULL) : string Take Unix timestamp and format to iCal date string
|
public static fromUnixDateTime(?int $datetime = NULL) : string Take Unix timestamp and format to iCal date/time string
|
public static fromUnixDateTimetoiCal(int $datetime) : string Format Unix timestamp to iCal date-time string
|
public static getAbsDate(string $date, string $rdate = '') : string Convert from a relative date to an absolute date Examples of relative dates are '-2y' for 2 years ago, '18m' for 18 months after today. Relative date uses 'y', 'm' and 'd' for year, month and day. Relative date can be combined into comma separated list, i.e., '-1y,-1d' for 1 year and 1 day ago.
|
public static getDateFromDay(int $date, int $week, int $wday, string $tzid = 'UTC') : int Date math: get date from week and day in specific month This routine finds actual dates for the second Tuesday of the month, last Friday of the month, etc. For second Tuesday, use $week = 1, $wday = 2 for last Friday, use $week = -1, $wday = 5
|
public static iCalDurationtoSeconds(string $duration) : int Convert iCal duration string to # of seconds
|
public static inDay(int $daystart, int $begin, int $end) : bool Check if day falls within date range
|
public static isAfterToday(int $date, string $tzid = 'UTC') : bool Is given date after today?
|
public static isBeforeToday(int $date, string $tzid = 'UTC') : bool Is given date before today?
|
public static isFuture(int $date, string $tzid = 'UTC') : bool Is given date in the future? This routine differs from isAfterToday() in that isFuture() will return true for date-time values later in the same day.
|
public static isPast(int $date, string $tzid = 'UTC') : bool Is given date in the past? This routine differs from isBeforeToday() in that isPast() will return true for date-time values earlier in the same day.
|
public static isToday(int $date, string $tzid = 'UTC') : bool Is given date today?
|
public static isTomorrow(int $date, string $tzid = 'UTC') : bool Is given date tomorrow?
|
public static isWeekend(int $date) : bool Is given date fall on a weekend?
|
public static now(string $tzid = 'UTC') : int Return current Unix timestamp in local timezone
|
public static toiCalDate(?int $datetime = NULL) : string Format Unix timestamp to iCal date format
|
public static toiCalDateTime(?int $datetime = NULL) : string Format Unix timestamp to iCal date-time format
|
public static toLocalDateTime(string $sqldate, string $tzid = 'UTC') : string Convert UTC date-time to local date-time
|
public static toSQLDate(int $t = 0) : string Format Unix timestamp to SQL date
|
public static toSQLDateTime(int $t = 0) : string Format Unix timestamp to SQL date-time
|
public static toUnixDate(string $datetime) : int Convert SQL date or date-time to Unix timestamp
|
public static toUnixDateTime(string $datetime) : int Convert SQL date or date-time to Unix date timestamp
|
public static toUTCDateTime(string $sqldate, string $tzid = 'UTC') : string Convert local date-time to UTC date-time
|