How to Subtract Minutes

后端 未结 12 992
情书的邮戳
情书的邮戳 2020-12-15 15:48

I want to send a reminder email.I don\'t want to use cron on Linux/Unix/BSD box or Scheduled Tasks on Windows.

I\'m trying to subtract 15 minutes from t

12条回答
  •  猫巷女王i
    2020-12-15 16:23

    To subtract 15 minutes you can do:

    date('Y-m-d H:i:s', (time() - 60 * 15));
    

    You can replace 15 with the number of minutes you want.

    In case you're looking to subtract seconds you can simply do:

    date('Y-m-d H:i:s', (time() - 10));
    

    In this way you'll subtract 10 seconds.

提交回复
热议问题