drhwb470572 2014-11-20 11:57
浏览 19

PHP - 上周六下午6点[重复]

This question already has an answer here:

I have a query where I want to pass in two variables and I feel like I am almost there but need a bit of guidance.

I have a cron job set up to run at 6pm every Saturday that will select tickets for the last week.

Select tickets that are between 6pm last saturday and 5:59 today bearing in mind that this willl be run at 6pm every saturday.

I'm looking for help to create two variables.

  • 6pm last Saturday
  • 5:59pm today

Have looked at strtotime and date but can't see anything that would fit?

</div>
  • 写回答

2条回答 默认 最新

  • douju7245 2014-11-20 12:08
    关注

    Check strtotime:

    $time = strtotime("last Saturday 6 PM");
    echo date("Y-m-d H:i:s", $time); 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号