Properties

$dependencies

$dependencies : 

Type

$shortcuts

$shortcuts : 

Type

$singleton

$singleton : 

Type

$class_hash

$class_hash : 

Type

$_shorts

$_shorts : 

Type

$_shorts_loaded

$_shorts_loaded : 

Type

$_class_index

$_class_index : 

Type

$ArrTimezones

$ArrTimezones : 

Type

$formtrans

$formtrans : 

Type

$possible_formats

$possible_formats : 

Type

$timestamp

$timestamp : 

Type

$userTimeZone

$userTimeZone : 

Type

$utcTimeZone

$utcTimeZone : 

Type

Methods

__get()

__get(  $strKey) 

Fetch the data provided in this class

Parameters

$strKey

__isset()

__isset(  $name) 

Parameters

$name

__dependencies()

__dependencies() 

__shortcuts()

__shortcuts() 

__destruct()

__destruct() 

__construct()

__construct() 

setTimezone()

setTimezone(string  $value) 

Sets the User Timezone

Parameters

string $value

Timezone

get_serverTimezone()

get_serverTimezone() : \timestamp

Return the default timezone if needed

Returns

\timestamp

mktime()

mktime(  $hour = '0',   $min = '0',   $sec = '0',   $month = '0',   $day = '0',   $year = '0') : \Timestamp

Mktime in UTC

Parameters

$hour

Hour int

$min

Minutes int

$sec

Seconds int

$month

Month int

$day

Day int

$year

Year int

Returns

\Timestamp

date()

date(  $format = "Y-m-d H:i:s",   $dtime = '') : \Formatted

Output proper Time

Parameters

$format

Format of the Output

$dtime

Timestamp in UTC

Returns

\Formatted —

time string

user_date()

user_date(  $time = false,   $withtime = false,   $timeonly = false, boolean  $long = false, boolean  $fromformat = true, boolean  $withday = false) : \formatted

Output Date in user-format

Parameters

$time
$withtime
$timeonly
boolean $long
boolean $fromformat
boolean $withday

Returns

\formatted —

String

date_for_user()

date_for_user(integer  $intUserID, integer  $time, boolean  $withtime = false, boolean  $timeonly = false, boolean  $long = false, boolean  $fromformat = true, boolean  $withday = false) 

Output Date in format for a specific User

Parameters

integer $intUserID
integer $time

Timestamp, in UTC

boolean $withtime
boolean $timeonly
boolean $long
boolean $fromformat
boolean $withday

convert_usertimestring_to_utc()

convert_usertimestring_to_utc(\unknown  $strTime) 

Converts a String in Usertime to a User Timestamp, usable for the other time methods

Parameters

\unknown $strTime

get_timediff_to_utc()

get_timediff_to_utc(\unknown  $inhours = false) 

Get the timezone offset in hours or seconds

Parameters

\unknown $inhours

timestamp_offset()

timestamp_offset(integer  $intTimestamp, integer  $intOffset) : integer

Adds an offset to a timestamp

Parameters

integer $intTimestamp
integer $intOffset

in Seconds, e.g. 3600

Returns

integer

convert_timestamp_to_utc()

convert_timestamp_to_utc(integer  $intSourceTimestamp, string  $strSourceTimezone) : integer

Converts a timestamp in another Timezone into an UTC Timestamp

Parameters

integer $intSourceTimestamp
string $strSourceTimezone

Returns

integer

convert_timestamp_from_utc()

convert_timestamp_from_utc(  $intSourceTimestamp) 

Parameters

$intSourceTimestamp

nice_date()

nice_date(  $time = false,   $differenceForDeactivating = false,   $withtime = false,   $timeonly = false,   $long = false,   $fromformat = true,   $withday = false) : \formatted

Output Date in nice-format, like 7 days ago

Parameters

$time
$differenceForDeactivating
$withtime
$timeonly
$long
$fromformat
$withday

Returns

\formatted —

String

fromformat()

fromformat(  $string,   $format) 

Parameters

$string
$format

removetimefromtimestamp()

removetimefromtimestamp(string  $timestamp) : integer

Removes H:i from Y-m-d H:i

Parameters

string $timestamp

Returns

integer

translateformat2js()

translateformat2js(  $format) 

Parameters

$format

translateformat2momentjs()

translateformat2momentjs(string  $format) : string

Transforms php date format into moment.js format

Parameters

string $format

PHP-Date-Format

Returns

string —

moment.js Format

createTimeTag()

createTimeTag(integer  $date, string  $strText, string  $strCSSClass = "") : string

Produces Time-Tag for moment.js

Parameters

integer $date
string $strText
string $strCSSClass

Returns

string

fetch_timezones()

fetch_timezones() : array

Fetch the timezones from server

Returns

array —

of timezones

RFC2822()

RFC2822(  $dtime) : \RFC2822

Return Date in RFC 2822 Compatible Output

Parameters

$dtime

Returns

\RFC2822 —

Time String

RFC822()

RFC822(  $dtime) 

Parameters

$dtime

DateRSS()

DateRSS(  $dtime) 

Parameters

$dtime

RFC3339()

RFC3339(  $dtime) : \RFC3339

Return Date in RFC 3339 Compatible Output

Parameters

$dtime

Returns

\RFC3339 —

Time String

getdate()

getdate(  $dtime = '') 

Parameters

$dtime

toSeconds()

toSeconds(  $time,   $ff = 'day') 

Parameters

$time
$ff

newtime()

newtime(  $timestamp,   $newtime = 'now',   $timeInUTC = true) 

Parameters

$timestamp
$newtime
$timeInUTC

dateDiff()

dateDiff(  $ts1,   $ts2,   $out = 'sec',   $pos_neg = false) 

Parameters

$ts1
$ts2
$out
$pos_neg

pos_neg()

pos_neg(  $timediff) 

Parameters

$timediff

age()

age(integer  $date) : integer

Returns the age of an date

Parameters

integer $date

Returns

integer

countBetweenDates()

countBetweenDates(  $array,   $startdate,   $enddate) 

Parameters

$array
$startdate
$enddate

createRepeatableEvents()

createRepeatableEvents(integer  $intUtcTimestamp, integer  $intSecondsToAdd, string  $strEventTimezone = '') : integer

Adds Seconds to a given UTC Timestamp.

Respects Winter/Summertime, because of given Timezone of Event Returns UTC Timestamp

Parameters

integer $intUtcTimestamp
integer $intSecondsToAdd
string $strEventTimezone

Returns

integer —

UTC Timestamp

gen_time()

gen_time(  $dtime = '') : \timestamp

Generate time() in UTC

Parameters

$dtime

Returns

\timestamp

check_format()

check_format(  $string,   $format) : boolean

Checks if $string is given in format $format

Parameters

$string
$format

Returns

boolean

formatOffset()

formatOffset(string  $offset) : string

Converts timezone offset to human-readable form Part of timezone fix

Parameters

string $offset

Returns

string

helper_repeatable_events()

helper_repeatable_events(  $intUtcTimestamp,   $intSecondsToAdd,   $objTimeZone) 

Parameters

$intUtcTimestamp
$intSecondsToAdd
$objTimeZone

helper_dtime()

helper_dtime(  $dtime) : \timestamp

Return the Date, an timestamp or now.

..

Parameters

$dtime

Returns

\timestamp

helper_countbetweendates()

helper_countbetweendates(  $timez) 

Parameters

$timez

helper_countfuturedays()

helper_countfuturedays(  $timez) 

Parameters

$timez