Mecha CMS

Date and time.

$date->to()

Convert current date to other date based on time zone input.

2.2.0
$date->to(string $zone = 'UTC');

Example:

$date = new Date('2019-09-18 16:56:06');

$A = $date->pattern('%h%:%m%:%s% %N%');
$B = $date->to('UTC')->pattern('%h%:%m%:%s% %N%');
$C = $B->parent->pattern('%h%:%m%:%s% %N%');

Result:

$A = '04:56:06 PM';
$B = '09:56:06 AM';
$C = '04:56:06 PM';