Please enable JavaScript to view this site.

Process Designer

Navigation: PHP API > Date and time zone

Date in default time zone (convertToDefaultTimezone)

Scroll Prev Top Next More

This function allows you to convert a date in form of the user's time zone into the default time zone of JobRouter.

Parameter

Type

Description

$dateTimeValueInUserTimezone

string

Date in this format: YYYY-MM-DD HH:MM:SS

$userTimezone

string

User time zone
(see http://php.net/manual/en/timezones.php for a complete list of supported time zones)

This function returns the date value of the default time zone. In case no default time zone was set, a JobRouterException is thrown.

Example (Default time zone of JobRouter since UTC):

$date = '2012-10-10 10:00:00;

$userTimezone = 'Europe/Berlin';

$dateInUtc = $this-> convertToDefaultTimezone($date, $userTimezone);

// $dateInUtc == '2012-10-10 09:00:00'