Documentation

TimezoneHandler

User Extended by Shawn Clake Class TimezoneHandler User Extended is licensed under the MIT license.

Tags
author

Shawn Clake shawn.clake@gmail.com

link
https://github.com/ShawnClake/UserExtended
license

https://github.com/ShawnClake/UserExtended/blob/master/LICENSE MIT

Table of Contents

getCurrentTime()  : mixed
Returns the current time as a Carbon object
getCurrentTimeAdjusted()  : Carbon
Adjust the current UTC time by minutes, hours, days, and seconds
getLoggedInUsersCurrentTimeAdjusted()  : Carbon
Get the current time adjusted via the logged in Users timezone
getLoggedInUsersTimeAdjusted()  : mixed
Get the time adjustment for the timezone of the currently logged in user.
getRelativeTimeString()  : mixed
The passed in time string should be in the applications default timezone.
getTimeAdjusted()  : mixed
Adjusts an arbitrary time by minutes, hours, days, and seconds
getTimeAdjustedByTimezone()  : mixed
Gets a time adjusted via a Timezone model.
getUsersCurrentTimeAdjusted()  : Carbon
Gets the current time adjusted via a Users timezone
getUTCTimezone()  : mixed
Return the default Timezone
twigRelativeTimeString()  : mixed
Returns a contextual relative time string. 5 seconds ago, 5 minutes ago.
twigTimezoneAdjustment()  : mixed
Handle the Twig filter for allowing us to automatically reformat dates for the appropriate timezone
getTimeStringAdjustments()  : array<string|int, mixed>
Take a time string such as 2:30 or 4:00 and convert it into minutes and hours

Methods

getCurrentTime()

Returns the current time as a Carbon object

public static getCurrentTime() : mixed
Return values
mixed

getCurrentTimeAdjusted()

Adjust the current UTC time by minutes, hours, days, and seconds

public static getCurrentTimeAdjusted( $minutes, int $hours, int $days, int $seconds) : Carbon
Parameters
$minutes :
$hours : int
$days : int
$seconds : int
Return values
Carbon

getLoggedInUsersCurrentTimeAdjusted()

Get the current time adjusted via the logged in Users timezone

public static getLoggedInUsersCurrentTimeAdjusted() : Carbon
Return values
Carbon

getLoggedInUsersTimeAdjusted()

Get the time adjustment for the timezone of the currently logged in user.

public static getLoggedInUsersTimeAdjusted( $time) : mixed
Parameters
$time :
Return values
mixed

getRelativeTimeString()

The passed in time string should be in the applications default timezone.

public static getRelativeTimeString(Carbon $time[, string $locale = 'en' ]) : mixed

By default this is UTC.

Parameters
$time : Carbon
$locale : string = 'en'
Return values
mixed

getTimeAdjusted()

Adjusts an arbitrary time by minutes, hours, days, and seconds

public static getTimeAdjusted( $time,  $minutes, int $hours, int $days, int $seconds) : mixed
Parameters
$time :
$minutes :
$hours : int
$days : int
$seconds : int
Return values
mixed

getTimeAdjustedByTimezone()

Gets a time adjusted via a Timezone model.

public static getTimeAdjustedByTimezone( $time, Timezone $timezone) : mixed
Parameters
$time :
$timezone : Timezone
Return values
mixed

getUsersCurrentTimeAdjusted()

Gets the current time adjusted via a Users timezone

public static getUsersCurrentTimeAdjusted( $user) : Carbon
Parameters
$user :
Return values
Carbon

getUTCTimezone()

Return the default Timezone

public static getUTCTimezone() : mixed
Return values
mixed

twigRelativeTimeString()

Returns a contextual relative time string. 5 seconds ago, 5 minutes ago.

public static twigRelativeTimeString( $time[, string $locale = 'en' ]) : mixed
Parameters
$time :
$locale : string = 'en'
Return values
mixed

twigTimezoneAdjustment()

Handle the Twig filter for allowing us to automatically reformat dates for the appropriate timezone

public static twigTimezoneAdjustment( $time) : mixed
Parameters
$time :
Return values
mixed

getTimeStringAdjustments()

Take a time string such as 2:30 or 4:00 and convert it into minutes and hours

private static getTimeStringAdjustments( $time) : array<string|int, mixed>
Parameters
$time :
Return values
array<string|int, mixed>

Search results