TTDate - staffcheck/api GitHub Wiki

TTDate

  • Class name: TTDate
  • Namespace:

Properties

$time_zone

protected mixed $time_zone = NULL
  • Visibility: protected
  • This property is static.

$date_format

protected mixed $date_format = 'd-M-y'
  • Visibility: protected
  • This property is static.

$time_format

protected mixed $time_format = 'g:i A T'
  • Visibility: protected
  • This property is static.

$time_unit_format

protected mixed $time_unit_format = 20
  • Visibility: protected
  • This property is static.

$month_arr

protected mixed $month_arr = array('jan' => 1, 'january' => 1, 'feb' => 2, 'february' => 2, 'mar' => 3, 'march' => 3, 'apr' => 4, 'april' => 4, 'may' => 5, 'jun' => 6, 'june' => 6, 'jul' => 7, 'july' => 7, 'aug' => 8, 'august' => 8, 'sep' => 9, 'september' => 9, 'oct' => 10, 'october' => 10, 'nov' => 11, 'november' => 11, 'dec' => 12, 'december' => 12)
  • Visibility: protected
  • This property is static.

$day_of_week_arr

public mixed $day_of_week_arr = NULL
  • Visibility: public
  • This property is static.

$long_month_of_year_arr

public mixed $long_month_of_year_arr = NULL
  • Visibility: public
  • This property is static.

$short_month_of_year_arr

public mixed $short_month_of_year_arr = NULL
  • Visibility: public
  • This property is static.

Methods

__construct

mixed TTDate::__construct()

TTDate constructor.

  • Visibility: public

_get_month_short_names

array TTDate::_get_month_short_names()
  • Visibility: private
  • This method is static.

_get_month_long_names

array TTDate::_get_month_long_names()
  • Visibility: private
  • This method is static.

isDST

boolean TTDate::isDST(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getTimeZone

string TTDate::getTimeZone()
  • Visibility: public
  • This method is static.

detectSystemTimeZone

string TTDate::detectSystemTimeZone()

Attempts to detect the full time zone in use by the system on both Windows and Linux.

  • Visibility: public
  • This method is static.

setTimeZone

boolean TTDate::setTimeZone(null $time_zone, boolean $force, boolean $execute_sql_now)
  • Visibility: public
  • This method is static.

Arguments

  • $time_zone null
  • $force boolean
  • $execute_sql_now boolean

setDateFormat

boolean TTDate::setDateFormat(integer $date_format)
  • Visibility: public
  • This method is static.

Arguments

  • $date_format integer - EPOCH

setTimeFormat

boolean TTDate::setTimeFormat($time_format)
  • Visibility: public
  • This method is static.

Arguments

  • $time_format mixed

setTimeUnitFormat

boolean TTDate::setTimeUnitFormat($time_unit_format)
  • Visibility: public
  • This method is static.

Arguments

  • $time_unit_format mixed

getTimeZoneOffset

false|string TTDate::getTimeZoneOffset()
  • Visibility: public
  • This method is static.

convertTimeZone

mixed TTDate::convertTimeZone(integer $epoch, $timezone)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $timezone mixed

convertSecondsToHMS

string TTDate::convertSecondsToHMS($seconds, boolean $include_seconds)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed
  • $include_seconds boolean

parseTimeUnit

boolean|float|integer|\number|string TTDate::parseTimeUnit($time_unit, null $format)
  • Visibility: public
  • This method is static.

Arguments

  • $time_unit mixed
  • $format null

getTimeUnit

boolean|integer|string TTDate::getTimeUnit($seconds, null $time_unit_format)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed
  • $time_unit_format null

isValidDate

boolean|false|integer|null TTDate::isValidDate($value)

Check to ensure that the date is within a validate integer range.

  • Visibility: public
  • This method is static.

Arguments

  • $value mixed

parseDateTime

boolean|false|integer|null TTDate::parseDateTime($str)
  • Visibility: public
  • This method is static.

Arguments

  • $str mixed

getHumanReadableDateStamp

false|string TTDate::getHumanReadableDateStamp(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getISODateStamp

false|string TTDate::getISODateStamp(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getISOTimeStamp

false|string TTDate::getISOTimeStamp(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getAPIDate

boolean|false|null|string TTDate::getAPIDate(string $format, integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $format string
  • $epoch integer - EPOCH

getDBTimeStamp

false|string TTDate::getDBTimeStamp(integer $epoch, boolean $include_time_zone)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $include_time_zone boolean

getDate

boolean|false|null|string TTDate::getDate(null $format, integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $format null
  • $epoch integer - EPOCH

getDayOfMonthArray

array TTDate::getDayOfMonthArray()
  • Visibility: public
  • This method is static.

getMonthOfYearArray

array|null TTDate::getMonthOfYearArray(boolean $short_name)
  • Visibility: public
  • This method is static.

Arguments

  • $short_name boolean

getDayOfWeekArray

array|null TTDate::getDayOfWeekArray(boolean $translation)
  • Visibility: public
  • This method is static.

Arguments

  • $translation boolean

getDayOfWeek

false|string TTDate::getDayOfWeek(integer $epoch, integer $start_week_day)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $start_week_day integer

getDayOfWeekName

boolean TTDate::getDayOfWeekName($dow)
  • Visibility: public
  • This method is static.

Arguments

  • $dow mixed

getDayOfYear

false|string TTDate::getDayOfYear(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getDayOfWeekByInt

boolean TTDate::getDayOfWeekByInt($int, boolean $translation)
  • Visibility: public
  • This method is static.

Arguments

  • $int mixed
  • $translation boolean

getDayOfWeekArrayByStartWeekDay

array TTDate::getDayOfWeekArrayByStartWeekDay(integer $start_week_day)
  • Visibility: public
  • This method is static.

Arguments

  • $start_week_day integer

isMidnight

boolean TTDate::isMidnight(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

doesRangeSpanMidnight

boolean TTDate::doesRangeSpanMidnight(integer $start_epoch, integer $end_epoch, boolean $match_midnight)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH
  • $match_midnight boolean

doesRangeSpanDST

boolean TTDate::doesRangeSpanDST(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getDSTOffset

integer TTDate::getDSTOffset(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getTime

integer TTDate::getTime()
  • Visibility: public
  • This method is static.

getSeconds

string TTDate::getSeconds($hours)
  • Visibility: public
  • This method is static.

Arguments

  • $hours mixed

getHours

string TTDate::getHours($seconds)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed

getDays

string TTDate::getDays($seconds)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed

getWeeks

string TTDate::getWeeks($seconds)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed

getYears

string TTDate::getYears($seconds)
  • Visibility: public
  • This method is static.

Arguments

  • $seconds mixed

getDaysInMonth

false|string TTDate::getDaysInMonth(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getDaysInYear

false|string TTDate::getDaysInYear(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

incrementDate

false|integer TTDate::incrementDate(integer $epoch, $amount, $unit)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $amount mixed
  • $unit mixed

snapTime

mixed TTDate::snapTime(integer $epoch, integer $snap_to_epoch, $snap_type)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $snap_to_epoch integer - EPOCH
  • $snap_type mixed

roundTime

integer TTDate::roundTime(integer $epoch, $round_value, integer $round_type, integer $grace_time)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $round_value mixed
  • $round_type integer
  • $grace_time integer

graceTime

mixed TTDate::graceTime(integer $current_epoch, $grace_time, integer $schedule_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $current_epoch integer - EPOCH
  • $grace_time mixed
  • $schedule_epoch integer - EPOCH

getTimeStampFromSmarty

integer|mixed TTDate::getTimeStampFromSmarty($prefix, $array)
  • Visibility: public
  • This method is static.

Arguments

  • $prefix mixed
  • $array mixed

getTimeStamp

integer|mixed TTDate::getTimeStamp(string $year, string $month, string $day, integer $hour, integer $min, integer $sec)
  • Visibility: public
  • This method is static.

Arguments

  • $year string
  • $month string
  • $day string
  • $hour integer
  • $min integer
  • $sec integer

getDayWithMostTime

mixed TTDate::getDayWithMostTime(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getDayDifference

boolean|float|integer TTDate::getDayDifference(integer $start_epoch, integer $end_epoch, boolean $round)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH
  • $round boolean

getWeekDifference

boolean|float|integer TTDate::getWeekDifference(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getMonthDifference

boolean|float|integer TTDate::getMonthDifference(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getYearDifference

boolean|float|integer TTDate::getYearDifference(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

getDateByMonthOffset

false|integer TTDate::getDateByMonthOffset(integer $epoch, $month_offset)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $month_offset mixed

getBeginMinuteEpoch

false|integer TTDate::getBeginMinuteEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getBeginDayEpoch

false|integer TTDate::getBeginDayEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getMiddleDayEpoch

false|integer TTDate::getMiddleDayEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getEndDayEpoch

false|integer TTDate::getEndDayEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getBeginMonthEpoch

false|integer TTDate::getBeginMonthEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getEndMonthEpoch

false|integer TTDate::getEndMonthEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getBeginQuarterEpoch

mixed TTDate::getBeginQuarterEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getEndQuarterEpoch

mixed TTDate::getEndQuarterEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getFiscalYearFromEpoch

false|string TTDate::getFiscalYearFromEpoch(integer $epoch, integer $offset)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $offset integer

getBeginYearEpoch

false|integer TTDate::getBeginYearEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getEndYearEpoch

false|integer TTDate::getEndYearEpoch(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getYearQuarterMonth

boolean|mixed TTDate::getYearQuarterMonth(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getYearQuarterMonthNumber

boolean|mixed TTDate::getYearQuarterMonthNumber(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getYearQuarter

float TTDate::getYearQuarter(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getYearQuarters

array|boolean|mixed TTDate::getYearQuarters(integer $epoch, null $quarter, integer $day_of_month)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $quarter null
  • $day_of_month integer

getDateOfNextDayOfWeek

boolean|false|integer TTDate::getDateOfNextDayOfWeek(integer $anchor_epoch, integer $day_of_week_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $anchor_epoch integer - EPOCH
  • $day_of_week_epoch integer - EPOCH

getDateOfNextDayOfMonth

boolean|false|integer TTDate::getDateOfNextDayOfMonth(integer $anchor_epoch, integer $day_of_month_epoch, null $day_of_month)
  • Visibility: public
  • This method is static.

Arguments

  • $anchor_epoch integer - EPOCH
  • $day_of_month_epoch integer - EPOCH
  • $day_of_month null

getDateOfNextQuarter

false|integer|mixed TTDate::getDateOfNextQuarter($anchor_epoch, integer $day_of_month, integer $month_of_quarter)
  • Visibility: public
  • This method is static.

Arguments

  • $anchor_epoch mixed
  • $day_of_month integer
  • $month_of_quarter integer

getDateOfNextYear

boolean|false|integer TTDate::getDateOfNextYear(integer $anchor_epoch, integer $year_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $anchor_epoch integer - EPOCH
  • $year_epoch integer - EPOCH

getLastHireDateAnniversary

false|integer TTDate::getLastHireDateAnniversary(integer $hire_date)
  • Visibility: public
  • This method is static.

Arguments

  • $hire_date integer - EPOCH

getBeginWeekEpoch

false|integer TTDate::getBeginWeekEpoch(integer $epoch, integer $start_day_of_week)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $start_day_of_week integer

getEndWeekEpoch

false|integer TTDate::getEndWeekEpoch(integer $epoch, integer $start_day_of_week)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $start_day_of_week integer

getWeek

integer TTDate::getWeek(integer $epoch, integer $start_week_day)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $start_week_day integer

getYear

false|string TTDate::getYear(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getMonth

false|string TTDate::getMonth(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getMonthName

boolean|mixed TTDate::getMonthName($month, boolean $short_name)
  • Visibility: public
  • This method is static.

Arguments

  • $month mixed
  • $short_name boolean

getDayOfMonth

false|string TTDate::getDayOfMonth(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getHour

false|string TTDate::getHour(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getMinute

false|string TTDate::getMinute(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getSecond

false|string TTDate::getSecond(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

isWeekDay

boolean TTDate::isWeekDay(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getAnnualWeekDays

integer TTDate::getAnnualWeekDays(integer $epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

getNearestWeekDay

integer TTDate::getNearestWeekDay(integer $epoch, integer $type, array $exclude_epochs)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $type integer
  • $exclude_epochs array

getDateArray

array TTDate::getDateArray(integer $start_date, integer $end_date, boolean $day_of_week)
  • Visibility: public
  • This method is static.

Arguments

  • $start_date integer - EPOCH
  • $end_date integer - EPOCH
  • $day_of_week boolean

getCalendarArray

array|boolean TTDate::getCalendarArray(integer $start_date, integer $end_date, integer $start_day_of_week, boolean $force_weeks)
  • Visibility: public
  • This method is static.

Arguments

  • $start_date integer - EPOCH
  • $end_date integer - EPOCH
  • $start_day_of_week integer
  • $force_weeks boolean

inWindow

boolean TTDate::inWindow(integer $epoch, integer $window_epoch, $window)
  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH
  • $window_epoch integer - EPOCH
  • $window mixed

getTimeOverLapDifference

boolean|mixed TTDate::getTimeOverLapDifference(integer $start_date1, integer $end_date1, integer $start_date2, integer $end_date2)
  • Visibility: public
  • This method is static.

Arguments

  • $start_date1 integer - EPOCH
  • $end_date1 integer - EPOCH
  • $start_date2 integer - EPOCH
  • $end_date2 integer - EPOCH

getTimeOverLap

array|boolean TTDate::getTimeOverLap(integer $start_date1, integer $end_date1, integer $start_date2, integer $end_date2)
  • Visibility: public
  • This method is static.

Arguments

  • $start_date1 integer - EPOCH
  • $end_date1 integer - EPOCH
  • $start_date2 integer - EPOCH
  • $end_date2 integer - EPOCH

isTimeOverLap

boolean TTDate::isTimeOverLap(integer $start_date1, integer $end_date1, integer $start_date2, integer $end_date2)
  • Visibility: public
  • This method is static.

Arguments

  • $start_date1 integer - EPOCH
  • $end_date1 integer - EPOCH
  • $start_date2 integer - EPOCH
  • $end_date2 integer - EPOCH

calculateTimeOnEachDayBetweenRange

array TTDate::calculateTimeOnEachDayBetweenRange(integer $start_epoch, integer $end_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $start_epoch integer - EPOCH
  • $end_epoch integer - EPOCH

splitDateRangeAtMidnight

array TTDate::splitDateRangeAtMidnight(\time $start_time_stamp, \time $end_time_stamp, \time|boolean $filter_start_time_stamp, \time|boolean $filter_end_time_stamp)

break up a timespan into array of days between times and on midnight if no filter break days on midnight only

  • Visibility: public
  • This method is static.

Arguments

  • $start_time_stamp time
  • $end_time_stamp time
  • $filter_start_time_stamp time|boolean
  • $filter_end_time_stamp time|boolean

getNextDateFromArray

mixed TTDate::getNextDateFromArray(integer $floor, array $dates)

returns next date from array that is after the floor date

  • Visibility: public
  • This method is static.

Arguments

  • $floor integer
  • $dates array

isConsecutiveDays

boolean TTDate::isConsecutiveDays(integer $date_array)
  • Visibility: public
  • This method is static.

Arguments

  • $date_array integer - EPOCH

getBirthDateAtAge

false|integer TTDate::getBirthDateAtAge(integer $birth_date, $age)
  • Visibility: public
  • This method is static.

Arguments

  • $birth_date integer - EPOCH
  • $age mixed

getTimeLockedDate

false|integer TTDate::getTimeLockedDate(integer $time_epoch, integer $date_epoch)
  • Visibility: public
  • This method is static.

Arguments

  • $time_epoch integer - EPOCH
  • $date_epoch integer - EPOCH

getEasterDays

float TTDate::getEasterDays($year)
  • Visibility: public
  • This method is static.

Arguments

  • $year mixed

getHumanTimeSince

string TTDate::getHumanTimeSince(integer $epoch)

Function to return "13 mins ago" text from a given time.

  • Visibility: public
  • This method is static.

Arguments

  • $epoch integer - EPOCH

strtotime

integer TTDate::strtotime($str)
  • Visibility: public
  • This method is static.

Arguments

  • $str mixed

isBindTimeStamp

boolean TTDate::isBindTimeStamp($str)
  • Visibility: public
  • This method is static.

Arguments

  • $str mixed

getTimePeriodOptions

array TTDate::getTimePeriodOptions(boolean $include_pay_period)
  • Visibility: public
  • This method is static.

Arguments

  • $include_pay_period boolean

getTimePeriodDates

array|boolean TTDate::getTimePeriodDates($time_period, integer $epoch, object $user_obj, null $params)
  • Visibility: public
  • This method is static.

Arguments

  • $time_period mixed
  • $epoch integer - EPOCH
  • $user_obj object
  • $params null

getReportDateOptions

array TTDate::getReportDateOptions(null $column_name_prefix, null $column_name, null $sort_prefix, boolean $include_pay_period)
  • Visibility: public
  • This method is static.

Arguments

  • $column_name_prefix null
  • $column_name null
  • $sort_prefix null
  • $include_pay_period boolean

getReportDates

array|boolean|false|null|string TTDate::getReportDates($column, integer $epoch, boolean $post_processing, object $user_obj, null $params)
  • Visibility: public
  • This method is static.

Arguments

  • $column mixed
  • $epoch integer - EPOCH
  • $post_processing boolean
  • $user_obj object
  • $params null

getISO8601Duration

string TTDate::getISO8601Duration($time)
  • Visibility: public
  • This method is static.

Arguments

  • $time mixed

inApplyFrequencyWindow

boolean TTDate::inApplyFrequencyWindow(integer $frequency_id, integer $start_date, integer $end_date, array $frequency_criteria)
  • Visibility: public
  • This method is static.

Arguments

  • $frequency_id integer
  • $start_date integer - EPOCH
  • $end_date integer - EPOCH
  • $frequency_criteria array
⚠️ **GitHub.com Fallback** ⚠️