php - add 3 minutes to date variable

后端 未结 2 1503
盖世英雄少女心
盖世英雄少女心 2021-01-16 02:11

I want to add 3 minutes to a date/time variable I have, but I\'m not sure how to do this. I made the variable from a string like this: (which is in the RFC 2822 date format

2条回答
  •  情书的邮戳
    2021-01-16 03:08

    You could just use strtotime twice:

    $date = strtotime('2011-10-18T19:56:00+0200');
    echo date('G:i', strtotime('+3 minutes', $date));
    

提交回复
热议问题