get the correct time period in php
来源:互联网 发布:usb端口不能用怎么办 编辑:程序博客网 时间:2024/05/21 18:45
1. the following is correct
$beginTime = 1193893200;
$endTime = 1194242400;
for ($myDate = $beginTime; $myDate <= $endTime; $myDate = strtotime("+1 day", $myDate)) {
$printable = strftime("%Y-%m-%d %H:%M:%S", $myDate);
echo $printable.'<br/>';
}
2 the following is wrong
$beginTime = '2007-11-01';
$endTime = '2007-11-05';
while (strtotime($beginTime) <= strtotime($endTime)) {
echo $beginTime."<br />";
$beginTime = date("Y-m-d", strtotime($beginTime)+(60*60*24));
$i++;
if ($i > 10) {
break;
}
}
$beginTime = 1193893200;
$endTime = 1194242400;
for ($myDate = $beginTime; $myDate <= $endTime; $myDate = strtotime("+1 day", $myDate)) {
$printable = strftime("%Y-%m-%d %H:%M:%S", $myDate);
echo $printable.'<br/>';
}
2 the following is wrong
$beginTime = '2007-11-01';
$endTime = '2007-11-05';
while (strtotime($beginTime) <= strtotime($endTime)) {
echo $beginTime."<br />";
$beginTime = date("Y-m-d", strtotime($beginTime)+(60*60*24));
$i++;
if ($i > 10) {
break;
}
}
0 0
- get the correct time period in php
- get time in socketpair()
- symbian add log and get the correct part
- How to get the current time in milliseconds in C Programming?
- how to get the function back trace in php
- Store User and Application Data in the Correct Location
- THE FIRST TIME coming in!
- The first time in CSDN.
- hackerrank The Time in Words
- A file with the correct name was found in this directory, but it is not the correct one.
- A guide to get you building OGRE from source with the default settings in the shortest possible time
- The following URL schemes found in your app are not in the correct format 解决方案
- Get date without time in C#
- How to link with the correct C Run-Time (CRT) library
- How to link with the correct C Run-Time (CRT) library
- How to get the current epoch time
- iOS The data couldn't be read because it isn't in the correct format
- 12.Which is the correct description of a pinned buffer in the database buffer cache?
- Python正则表达式指南
- 利用nodejs进行大文件(比如在线视频)的读取
- 1027. Colors in Mars (20)
- Android之仿今日头条标题栏效果
- (Visual Studio) Part 3: Using Breakpoints Effectively
- get the correct time period in php
- SQL Server 2008 R2如何开启数据库的远程连接
- Java及Android常用设计模式
- springmvc 登陆后跳转到登陆前的画面
- Sublime Text 3 支持的热门插件推荐
- 如何成为一名优秀的部属
- Linux 下配置OpenGL开发环境
- printf()格式化输出详解
- new UI-布局之LinearLayout(线性布局)详解