从上周六(每周)获取时间戳? [英] Getting the timestamp from last saturday (every week)?

查看:86
本文介绍了从上周六(每周)获取时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先让我告诉你我的代码:

  $ lastWeek = date('md-Y',strtotime(' 1周')); 

这是如何获取上周的时间戳。
有机会从上个星期六获取时间戳吗?



我希望你知道我的意思。



非常感谢



  $ last_sat = strtotime(上个星期六); 

编辑



时间应该设置为'00:00:00';

  echo date('dMY H:i:s ',$ last_sat); 

  2011年1月29日00:00:00 


first let me show you my code:

$lastWeek = date('m-d-Y', strtotime('-1 week'));

That's how to get the timestamp from last week. Is there a chance I gan get the timestamp from last saturday?

I hope you know what I mean.

Thanks a lot.

解决方案

What's wrong with

$last_sat = strtotime("last Saturday"); 

EDIT

The time should be set to '00:00:00';

echo date('d-M-Y H:i:s',$last_sat);

gives

29-Jan-2011 00:00:00

这篇关于从上周六(每周)获取时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆