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 |
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'
…