Doing an API integration that requires timezones to be handed off in W3C format, while Drupal opts to store timezones in seconds.
Wondering what the clean way to do this is, rather than stripping the +/- sign, dividing by 3600 and adding it back on. There has to be a date transformation right?
FYI... W3C looks like this: -08:00 and Drupal looks like this: -28800
Trying to avoid this code...
// $val = '-28800';
$sec = substr($val, 1);
$hours = intval(intval($sec) / 3600);
$minutes = intval(($sec / 60) % 60);
$w3cTZ = substr($val, 0, 1) .
str_pad($hours, 2, "0", STR_PAD_LEFT) .":".
str_pad($minutes, 2, "0", STR_PAD_LEFT);