Time
in package
Table of Contents
Methods
- dateDiff() : string
- PARA: Date Should In YYYY-MM-DD Format RESULT FORMAT: '%y Year %m Month %d Day %h Hours %i Minute %s Seconds' => 1 Year 3 Month 14 Day 11 Hours 49 Minute 36 Seconds '%y Year %m Month %d Day' => 1 Year 3 Month 14 Days '%m Month %d Day' => 3 Month 14 Day '%d Day %h Hours' => 14 Day 11 Hours '%d Day' => 14 Days '%h Hours %i Minute %s Seconds' => 11 Hours 49 Minute 36 Seconds '%i Minute %s Seconds' => 49 Minute 36 Seconds '%h Hours => 11 Hours '%a Days => 468 Days
- getBetween() : array<string|int, mixed>
- getChangeTimeTag() : string
- Returns a complete string of <span class="{css}" title="{date_time}">{lngBasicChanged}</span>
- getDate() : array{DATE_TIME: string, DATE_TS: string, DATE_ISO_HOUR: string, DATE: string, YEAR: string, MONTH: string, MONTH_DAY: string, ISO_FORMAT: string}
- getIntlDate() : string
- getLocalTime() : string
- Returns target time in iso 8601 by calculating from server timezone to target timezone
- getMinToTime() : array<string|int, mixed>
- Gibt array zurueck mit Jahr, Monat, Tag und Zeit und kompletten String
- getNiceDate() : string
- uebersetzt timestamp in lesbares deutsches oder englisches Format
- getNiceMonthYear() : bool|string
- getStartsIn() : string
- getTimeAgo() : string
- Hilfsfunktion, die GetMinutesToTime, GetTimeDiff und GetNiceDate klammert Gibt die vergangene Zeit zurueck
- getTimeDiff() : float|int
- Ermittelt die Anzahl an Tagen, Stunden und Minuten zwischen zwei Zeitpunkten
- isOld() : bool
- isPast() : int
- returns 1 if the date is in the past
- validateTimeFormat() : bool
- getMinToTimeOLD() : array<string|int, mixed>
- Returns array with hours and minutes
Methods
dateDiff()
PARA: Date Should In YYYY-MM-DD Format RESULT FORMAT: '%y Year %m Month %d Day %h Hours %i Minute %s Seconds' => 1 Year 3 Month 14 Day 11 Hours 49 Minute 36 Seconds '%y Year %m Month %d Day' => 1 Year 3 Month 14 Days '%m Month %d Day' => 3 Month 14 Day '%d Day %h Hours' => 14 Day 11 Hours '%d Day' => 14 Days '%h Hours %i Minute %s Seconds' => 11 Hours 49 Minute 36 Seconds '%i Minute %s Seconds' => 49 Minute 36 Seconds '%h Hours => 11 Hours '%a Days => 468 Days
public
static dateDiff(string $date1, string $date2[, string $differenceFormat = '%a' ]) : string
Parameters
- $date1 : string
- $date2 : string
- $differenceFormat : string = '%a'
Return values
stringgetBetween()
public
static getBetween([string $nYear = '' ][, string $nMonth = '01' ][, string $strStep = 'months' ]) : array<string|int, mixed>
Parameters
- $nYear : string = ''
- $nMonth : string = '01'
- $strStep : string = 'months'
Tags
Return values
array<string|int, mixed>getChangeTimeTag()
Returns a complete string of <span class="{css}" title="{date_time}">{lngBasicChanged}</span>
public
static getChangeTimeTag(mixed $strDatetime) : string
Parameters
- $strDatetime : mixed
-
- iso
Return values
stringgetDate()
public
static getDate() : array{DATE_TIME: string, DATE_TS: string, DATE_ISO_HOUR: string, DATE: string, YEAR: string, MONTH: string, MONTH_DAY: string, ISO_FORMAT: string}
Return values
array{DATE_TIME: string, DATE_TS: string, DATE_ISO_HOUR: string, DATE: string, YEAR: string, MONTH: string, MONTH_DAY: string, ISO_FORMAT: string}getIntlDate()
public
static getIntlDate(string $strDatetime, string $dateFormat) : string
Parameters
- $strDatetime : string
- $dateFormat : string
Return values
stringgetLocalTime()
Returns target time in iso 8601 by calculating from server timezone to target timezone
public
static getLocalTime(string $strTime) : string
Parameters
- $strTime : string
Return values
stringgetMinToTime()
Gibt array zurueck mit Jahr, Monat, Tag und Zeit und kompletten String
public
static getMinToTime(int $nMinutes[, bool $bGetShort = false ]) : array<string|int, mixed>
Parameters
- $nMinutes : int
- $bGetShort : bool = false
Tags
Return values
array<string|int, mixed> —- dhm_string
getNiceDate()
uebersetzt timestamp in lesbares deutsches oder englisches Format
public
static getNiceDate([string $strDatetime = '' ][, int $showDayName = 0 ][, int $yearFormat = 1 ][, int $showTime = 0 ]) : string
Parameters
- $strDatetime : string = ''
- $showDayName : int = 0
-
0 = keiner
- $yearFormat : int = 1
-
0 = keins, 1=zweistellig, 2=vierstellig
- $showTime : int = 0
-
0 = keine zeit, 1 = zeit in hh:mm, zb: 16:10
Return values
stringgetNiceMonthYear()
public
static getNiceMonthYear([string $date = '' ]) : bool|string
Parameters
- $date : string = ''
Return values
bool|stringgetStartsIn()
public
static getStartsIn(string $strStartDate, string $strEndDate) : string
Parameters
- $strStartDate : string
- $strEndDate : string
Tags
Return values
stringgetTimeAgo()
Hilfsfunktion, die GetMinutesToTime, GetTimeDiff und GetNiceDate klammert Gibt die vergangene Zeit zurueck
public
static getTimeAgo(string $strIsoDate[, int $bToGo = 0 ][, string $strPreTitle = '' ][, bool $bTimeOnly = false ]) : string
Parameters
- $strIsoDate : string
-
YYYY-MM-DD hh:mm:ss
- $bToGo : int = 0
-
- wenn 1, wird die zeit bis IsoDate ermittelt
- $strPreTitle : string = ''
-
- setzt einen title vor das datum
- $bTimeOnly : bool = false
-
- wenn 1, wird nur zeit, wenn 0, dann inkl
Tags
Return values
string —span-element
getTimeDiff()
Ermittelt die Anzahl an Tagen, Stunden und Minuten zwischen zwei Zeitpunkten
public
static getTimeDiff([mixed $strDatumStart = '' ][, mixed $strDatumEnd = '' ][, string $strWhat = 'days' ]) : float|int
Parameters
- $strDatumStart : mixed = ''
-
- empty or iso format. if empty we use Cfg::getDates()['DATE_TIME']
- $strDatumEnd : mixed = ''
- $strWhat : string = 'days'
-
- days, hours, min, sec
Tags
Return values
float|int —- Differenz in Tagen (float) , Stunden (float), Minuten (int), Sekunden (int)
isOld()
public
static isOld(string $partydate) : bool
Parameters
- $partydate : string
Return values
boolisPast()
returns 1 if the date is in the past
public
static isPast(string|null $partydate) : int
Parameters
- $partydate : string|null
Return values
intvalidateTimeFormat()
public
static validateTimeFormat(string $strTime) : bool
Parameters
- $strTime : string
Return values
boolgetMinToTimeOLD()
Returns array with hours and minutes
private
static getMinToTimeOLD(int $nMinutes) : array<string|int, mixed>
Parameters
- $nMinutes : int
-
- Anzahl der Minuten