Jump to content

AlexGentili

New Members
  • Posts

    1
  • Joined

  • Last visited

AlexGentili's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. this works great and does what it should, but if I had a time format with cents, for example 10:00:00.00 I can't make the change, any ideas? // convert your date to DateTime object $date = '10:00:00'; $dt = new DateTime($date); // convert your period to DateInterval$hours = '00:25:10'; /* this data dynamic */ $parts = explode(':', $hours); $interval = new DateInterval('PT' . (int)$parts[0] . 'H' . $parts[1] . 'M' . $parts[2] . 'S'); // Add interval to date $dt->add($interval);// Format date as you needecho $dt->format('H:i:s');
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.