日期字串格式和时间戳格式转化
来源:互联网 发布:淘宝合作快递 编辑:程序博客网 时间:2024/06/04 01:03
function to_timespan($str, $format = 'Y-m-d H:i:s'){
$timezone = intval(C('TIME_ZONE'));
//$timezone = 8;
$time = intval(strtotime($str));
if($time!=0)
$time = $time - $timezone * 3600;
return $time;
}
function to_date($utc_time, $format = 'Y-m-d H:i:s') {
if (empty ( $utc_time )) {
return '';
}
$timezone = intval(C('TIME_ZONE'));
$time = $utc_time + $timezone * 3600;
return date ($format, $time );
}
$timezone = intval(C('TIME_ZONE'));
//$timezone = 8;
$time = intval(strtotime($str));
if($time!=0)
$time = $time - $timezone * 3600;
return $time;
}
function to_date($utc_time, $format = 'Y-m-d H:i:s') {
if (empty ( $utc_time )) {
return '';
}
$timezone = intval(C('TIME_ZONE'));
$time = $utc_time + $timezone * 3600;
return date ($format, $time );
}
0 0
- 日期字串格式和时间戳格式转化
- js内时间戳日期格式转化
- PHP 时间戳转化为日期格式
- 时间戳转化为日期格式
- 时间和日期格式
- 日期和时间格式
- 菜鸟集中营,关于时间,日期和格式的转化处理
- 字串日期格式转换
- 字串日期格式转换
- oracle 将时间戳转化为日期格式
- js时间戳怎么转化为日期格式
- vue2.0怎样将时间戳转化为日期格式
- 毫秒数转化为日期时间格式
- java 日期时间格式控制及转化
- java-转换时间日期格式字串为long型
- PHP日期和时间格式
- 时间格式字符串转化为date和时间戳
- Android 各种时间格式转化和获取时间戳
- UI控件--GridView
- 超链接中的javascript:void(0)问题
- git分支管理
- .pch 文件找不到 XCTest/XCTest.h' file not found ..
- 网络连接类的封装,GET,POST以及单文件上传,多文件上传
- 日期字串格式和时间戳格式转化
- freemarker高级用法
- Leet Code OJ 338. Counting Bits [Difficulty: Medium]
- RedHatOpenStack学习之三安全组及密钥对
- Android App 线上热修复方案
- C#编程基础 实验(2)
- js利用formdata实现ajax传递表单
- 程序员必须知道的10大基础实用算法及其讲解
- libevent http服务器实现