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-06-25 15:35:36');

$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 = '03:35:36 PM';
$B = '08:35:36 AM';
$C = '03:35:36 PM';