Smartyで数日前/数日後を計算
基準日からの経過した(明日、昨日、週、秒、分、時間)日時の計算方法
Smarty
{* 現在 2022/05/20 *}
{$smarty.now|date_format:'%Y/%m/%d'}
{* 明日 2022/05/21 *}
{assign var="tomorrow" value=$smarty.now+24*60*60}
{$tomorrow|date_format:'%Y/%m/%d'}
{* 昨日 2022/05/19 *}
{assign var="yesterday" value=$smarty.now-24*60*60}
{$yesterday|date_format:'%Y/%m/%d'}
{* 1週間後 2022/05/27 *}
{assign var="week" value=$smarty.now+24*60*60*7}
{$week|date_format:'%Y/%m/%d'}
{* 30秒後 2022-05-20 15:37:12 *}
{assign var="second" value=$smarty.now+30}
{$second|date_format:'%Y/%m/%d %H:%M:%S'}
{* 30分後 2022-05-20 16:06:42 *}
{assign var="minute" value=$smarty.now+60*30}
{$minute|date_format:'%Y/%m/%d %H:%M:%S'}
{* 24時間後 2022-05-21 15:36:42 *}
{assign var="hour" value=$smarty.now+24*60*60}
{$hour|date_format:'%Y/%m/%d %H:%M:%S'}