位置: 编程技术 - 正文

PHP:strptime()的用法_Date Time函数(php stl)

编辑:rootadmin
strptime

推荐整理分享PHP:strptime()的用法_Date Time函数(php stl),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php stl,php timer,php的strcmp,php中strtotime,php中strtotime,php中strtotime,php的strcmp,php strftime,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.1.0)

strptime — 解析由 strftime() 生成的日期/时间

说明 array strptime ( string $date , string $format )

strptime() 返回一个将 date 解析后的数组,如果出错返回 FALSE。

月份和星期几的名字以及其它与语种有关的字符串对应于 setlocale()设定的当前区域(LC_TIME)。

参数

date(string)

被解析的字符串(例如从 strftime() 返回的)

format(string)

date 所使用的格式(例如同 strftime() 中所使用的相同)。

更多有关格式选项的信息见 strftime() 页面。

返回值

返回一个数组 或者在失败时返回 FALSE

数组中包含以下单元 键名 说明 tm_sec 当前分钟内的秒数(0-) tm_min 当前小时内的分钟数(0-) tm_hour 午夜起的小时数(0-) tm_mday 月份中的第几天(1-) tm_mon 自一月起过了几个月(0-) tm_year 自 年起过了几年 tm_wday 自星期天起过了几天(0-6) tm_yday 本年自一月一日起过了多少天(0-) unparsed date 中未能通过指定的 format 识别的部分

范例 PHP:strptime()的用法_Date Time函数(php stl)

Example #1 strptime() 例子

<?php$format='%d/%m/%Y%H:%M:%S';$strf=strftime($format);echo"$strfn";print_r(strptime($strf,$format));?>

以上例程的输出类似于:

注释

Note: 此函数未在 Windows 平台下实现。

Note:

Internally, this function calls the strptime() function provided by the system&#;s C library. This function can exhibit noticeably different behaviour across different operating systems. The use of date_parse_from_format(), which does not suffer from these issues, is recommended on PHP 5.3.0 and later.

Note:

"tm_sec" includes any leap seconds (currently upto 2 a year). For more information on leap seconds, see the »Wikipedia article on leap seconds.

Note:

Prior to PHP 5.2.0, this function could return undefined behaviour. Notably, the "tm_sec", "tm_min" and "tm_hour" entries would return undefined values.

参见

checkdate() - 验证一个格里高里日期 strftime() - 根据区域设置格式化本地时间/日期 date_parse_from_format() - Get info about given date formatted according to the specified format DateTime::createFromFormat() - Returns new DateTime object formatted according to the specified format

PHP:mktime()的用法_Date Time函数 mktime(PHP4,PHP5)mktime取得一个日期的Unix时间戳说明intmktime([int$hour=date(H)[,int$minute=date(i)[,int$second=date(s)[,int$month=date(n)[,int$day=date(j)[,int$year=date(Y)[,int$is_dst=-1]

PHP:microtime()的用法_Date Time函数 microtime(PHP4,PHP5)microtime返回当前Unix时间戳和微秒数说明mixedmicrotime([bool$get_as_float])microtime()当前Unix时间戳以及微秒数。本函数仅在支持gettimeofday()系统调

PHP:localtime()的用法_Date Time函数 localtime(PHP4,PHP5)localtime取得本地时间说明arraylocaltime([int$timestamp=time()[,bool$is_associative=false]])localtime()函数返回一个数组,其结构和C函数调用返回的完全一

标签: php stl

本文链接地址:https://www.jiuchutong.com/biancheng/287359.html 转载请保留说明!

上一篇:PHP:strftime()的用法_Date Time函数(php strtr)

下一篇:PHP:mktime()的用法_Date Time函数(php使用memcache)

  • 收到其他与经营活动有关的现金是什么意思
  • 城建税减免性质代码怎么选择2020年4月
  • 关税完税价格是到岸价吗
  • 工资个税计提多了实际交的少
  • 个人所得税定期定额起征点
  • 全年一次性奖金税收计算器
  • 房产未竣工如何缴纳房产税
  • 企业合并固定资产增值的规定
  • 药店商品进销差价
  • 以库存商品抵偿债务
  • 施工企业项目部职责
  • 公司购入空调可以抵扣进项吗
  • 物业 免物业费
  • 境外企业分红怎么交税
  • 异地设立分公司可以独立核算吗
  • 增值税申报收入和企业所得税申报收入
  • 股东分红如何合理节税
  • 现金买东西可以退吗
  • 三类不良行为
  • 实收资本里的钱怎么做账
  • 税控盘年费每年都可以抵扣吗
  • 行政事业单位会计科目一览表
  • 一般户收到基本户转账的会计分录
  • 招大学生做兼职的网站
  • 支付工程款会计处理
  • 公司清算实收资本是零吗
  • 公户转私户的钱怎么退回来
  • 个体户开劳务费发票需要交哪些税
  • 年报企业控股情况怎么填
  • 上市公司的组织形式
  • php header refresh
  • 上市公司股票如何套现
  • 电脑文件删除怎么恢复找回
  • 以固定资产换入无形资产
  • 资源税纳税申报流程
  • 工会经费用途规定
  • 税务局要求小规模纳税人开专票
  • 预提费用的账务处理
  • 进出口公司如何做账
  • 增值税附加税必须交吗
  • php中preg_replace_callback函数简单用法示例
  • 职工福利费属于短期薪酬吗
  • phpcms使用教程
  • 税局通知纳税人的短信
  • 咨询公司业务流程
  • 税额和税款是一回事吗
  • 社保可以补交吗
  • 航天信息服务费280元会计处理
  • 商誉的会计核算怎么核算
  • 购买商品的会计科目
  • 运输公司内账会计每天需要做什么
  • 累计折旧需要分录吗
  • 材料暂估入库的附件需要哪些资料
  • 跨年度冲红字发票账务处理
  • 黄金以旧换新是不是不划算
  • 汇算清缴主要检查什么
  • 弥补亏损后怎么做账
  • 多个客户账款明细
  • vs显示进程已退出
  • Win7注册表怎么恢复
  • windows10指纹用不了
  • mac win10 wifi
  • centos7 dns
  • softmangerlite.exe是什么进程 有什么用
  • ddriver进程
  • 让xp系统瘫痪
  • 5.2光源
  • javascript继承原理
  • number fields to_char
  • python socketio
  • 一个简单的shell脚本
  • 批处理系统的进程调度算法
  • 基于android的简单程序
  • javascript面向对象编程指南 pdf
  • jquery简单吗
  • android 多页面
  • python中编写程序
  • 留抵税额过多怎么办
  • 税控盘百旺怎样清卡
  • 青岛国税服务电话
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设