TimeHelper
Table of Contents
Methods
-
buildDatesIterator()
: DatePeriod
-
buildTimestampByFormattedDateForServer()
: mixed
-
convertHoursMinutesToSeconds()
: mixed
-
convertSecondsToHoursMinutes()
: mixed
-
convertSecondsToHoursMinutesAmPm()
: mixed
-
convertSecondsToHoursMinutesLocal()
: mixed
-
convertUtcTimestampToDaySeconds()
: mixed
-
convertUtcTimestampToHoursMinutes()
: mixed
-
convertUtcTimestampToHoursMinutesAmPm()
: mixed
-
createDateTimeFromFormat()
: mixed
-
createTimezoneByOffset()
: mixed
-
createUserDateTimeFromFormat()
: null|DateTime
-
formatDateTime()
: string
-
getCurrentServerDateFormatted()
: mixed
-
getDateFormat()
: mixed
-
getDayOfWeek()
: mixed
-
getDefaultServerTimezoneName()
: mixed
-
getFormattedOffset()
: mixed
-
getHours()
: mixed
-
getInstance()
: static
-
getMinutes()
: mixed
-
getNextDayOfWeek()
: mixed
-
getPreviousDayOfWeek()
: mixed
-
getSeconds()
: mixed
-
getSecondsFromDateTime()
: int
-
getServerIsoDate()
: mixed
-
getServerUtcOffset()
: mixed
-
getTimeRegExp()
: mixed
-
getTimestampByUserDate()
: mixed
-
getTimestampByUserSeconds()
: mixed
-
getTimestampByUserSecondsFromTimestamp()
: mixed
-
getUserDateTimeNow()
: mixed
-
getUserTimezone()
: mixed
-
getUserToServerOffset()
: mixed
-
getUserUtcOffset()
: mixed
-
getUtcNowTimestamp()
: mixed
-
getUtcTimestampForUserTime()
: mixed
-
normalizeSeconds()
: mixed
-
setTimeFromSeconds()
: mixed
-
setTimezoneOffsets()
: mixed
buildDatesIterator()
public
buildDatesIterator(DateTime $from, DateTime|int $toOrDaysCount) : DatePeriod
Parameters
-
$from
: DateTime
-
-
$toOrDaysCount
: DateTime|int
-
-
throws
-
Exception
public
buildTimestampByFormattedDateForServer(mixed $formattedDate[, mixed $dateFormat = false ]) : mixed
Parameters
-
$formattedDate
: mixed
-
-
$dateFormat
: mixed
= false
-
convertHoursMinutesToSeconds()
public
convertHoursMinutesToSeconds(mixed $value) : mixed
Parameters
-
$value
: mixed
-
convertSecondsToHoursMinutes()
public
convertSecondsToHoursMinutes(mixed $seconds[, mixed $leadingHourZero = true ]) : mixed
Parameters
-
$seconds
: mixed
-
-
$leadingHourZero
: mixed
= true
-
convertSecondsToHoursMinutesAmPm()
public
convertSecondsToHoursMinutesAmPm(mixed $seconds) : mixed
Parameters
-
$seconds
: mixed
-
convertSecondsToHoursMinutesLocal()
public
convertSecondsToHoursMinutesLocal(mixed $seconds[, mixed $keepZeroHours = true ]) : mixed
Parameters
-
$seconds
: mixed
-
-
$keepZeroHours
: mixed
= true
-
convertUtcTimestampToDaySeconds()
public
convertUtcTimestampToDaySeconds(mixed $timestamp[, mixed $offset = 0 ]) : mixed
Parameters
-
$timestamp
: mixed
-
-
$offset
: mixed
= 0
-
convertUtcTimestampToHoursMinutes()
public
convertUtcTimestampToHoursMinutes(mixed $timestamp[, mixed $offset = 0 ]) : mixed
Parameters
-
$timestamp
: mixed
-
-
$offset
: mixed
= 0
-
convertUtcTimestampToHoursMinutesAmPm()
public
convertUtcTimestampToHoursMinutesAmPm(mixed $timestamp[, mixed $offset = 0 ]) : mixed
Parameters
-
$timestamp
: mixed
-
-
$offset
: mixed
= 0
-
public
createDateTimeFromFormat(mixed $format, mixed $dateString[, mixed $offset = 0 ]) : mixed
Parameters
-
$format
: mixed
-
-
$dateString
: mixed
-
-
$offset
: mixed
= 0
-
createTimezoneByOffset()
public
createTimezoneByOffset(mixed $offsetSeconds) : mixed
Parameters
-
$offsetSeconds
: mixed
-
public
createUserDateTimeFromFormat(string $format, string $dateString, int $userId) : null|DateTime
Parameters
-
$format
: string
-
-
$dateString
: string
-
-
$userId
: int
-
Return values
null|DateTime
public
formatDateTime(DateTime|int $dateTime, mixed $format[, string|null $languageId = null ]) : string
Parameters
-
$dateTime
: DateTime|int
-
-
$format
: mixed
-
-
$languageId
: string|null
= null
-
public
getCurrentServerDateFormatted() : mixed
public
getDateFormat() : mixed
getDayOfWeek()
public
getDayOfWeek(DateTime $dateTime) : mixed
Parameters
-
$dateTime
: DateTime
-
getDefaultServerTimezoneName()
public
getDefaultServerTimezoneName() : mixed
public
getFormattedOffset(mixed $offsetSeconds[, mixed $leadingHourZero = true ]) : mixed
Parameters
-
$offsetSeconds
: mixed
-
-
$leadingHourZero
: mixed
= true
-
getHours()
public
getHours(mixed $secs) : mixed
Parameters
-
$secs
: mixed
-
getInstance()
public
static getInstance() : static
getMinutes()
public
getMinutes(mixed $secs) : mixed
Parameters
-
$secs
: mixed
-
getNextDayOfWeek()
public
getNextDayOfWeek(DateTime $userDateTime) : mixed
Parameters
-
$userDateTime
: DateTime
-
getPreviousDayOfWeek()
public
getPreviousDayOfWeek(DateTime $userDateTime) : mixed
Parameters
-
$userDateTime
: DateTime
-
getSeconds()
public
getSeconds(mixed $secs) : mixed
Parameters
-
$secs
: mixed
-
getSecondsFromDateTime()
public
getSecondsFromDateTime(DateTime|DateTime $dateTime) : int
Parameters
-
$dateTime
: DateTime|DateTime
-
getServerIsoDate()
public
getServerIsoDate() : mixed
getServerUtcOffset()
public
getServerUtcOffset() : mixed
getTimeRegExp()
public
getTimeRegExp([mixed $ignoreAmPmMode = false ]) : mixed
Parameters
-
$ignoreAmPmMode
: mixed
= false
-
getTimestampByUserDate()
public
getTimestampByUserDate(mixed $formattedDate, mixed $userId[, mixed $format = null ]) : mixed
Parameters
-
$formattedDate
: mixed
-
-
$userId
: mixed
-
-
$format
: mixed
= null
-
getTimestampByUserSeconds()
public
getTimestampByUserSeconds(mixed $userId, mixed $seconds) : mixed
Parameters
-
$userId
: mixed
-
-
$seconds
: mixed
-
getTimestampByUserSecondsFromTimestamp()
public
getTimestampByUserSecondsFromTimestamp(mixed $seconds[, mixed $initialTimestamp = null ][, mixed $initialOffset = null ]) : mixed
Parameters
-
$seconds
: mixed
-
-
$initialTimestamp
: mixed
= null
-
-
$initialOffset
: mixed
= null
-
getUserDateTimeNow()
public
getUserDateTimeNow(mixed $userId) : mixed
Parameters
-
$userId
: mixed
-
getUserTimezone()
public
getUserTimezone(mixed $userId) : mixed
Parameters
-
$userId
: mixed
-
getUserToServerOffset()
public
getUserToServerOffset([mixed $userId = null ]) : mixed
Parameters
-
$userId
: mixed
= null
-
getUserUtcOffset()
public
getUserUtcOffset(mixed $userId) : mixed
Parameters
-
$userId
: mixed
-
getUtcNowTimestamp()
public
getUtcNowTimestamp() : mixed
getUtcTimestampForUserTime()
public
getUtcTimestampForUserTime(mixed $userId, mixed $daySeconds[, mixed $date = null ]) : mixed
Parameters
-
$userId
: mixed
-
-
$daySeconds
: mixed
-
-
$date
: mixed
= null
-
normalizeSeconds()
public
normalizeSeconds(mixed $seconds) : mixed
Parameters
-
$seconds
: mixed
-
setTimeFromSeconds()
public
setTimeFromSeconds(DateTime $dateTime, mixed $seconds) : mixed
Parameters
-
$dateTime
: DateTime
-
-
$seconds
: mixed
-
setTimezoneOffsets()
public
setTimezoneOffsets(mixed $offsetsByUserId) : mixed
Parameters
-
$offsetsByUserId
: mixed
-