Please enable JavaScript to view this site.

Process Designer

Navigation: PHP API > Date and time zone

Date in user's time zone (convertToUserTimezone)

Scroll Prev Top Next More

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

Parameter

Type

Description

$dateTimeValueInDefaultTimezone

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 user's 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 09:00:00; // UTC date

$userTimezone = 'Europe/Berlin';

$dateInUserTZ = $this-> convertToUserTimezone($date, $userTimezone);

// $dateInUserTZ == '2012-10-10 10:00:00'