如何将时间戳转换为mm:dd:yy格式。 [英] How to convert timestamp into mm:dd:yy format.

查看:641
本文介绍了如何将时间戳转换为mm:dd:yy格式。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的mysql数据库表中有一个时间戳类型字段。现在扔php我需要把它改成mm:dd:yy formate.Threw巫婆功能我能做到。请帮我一个考试。假设时间戳是这个20070209162211然后我怎么能把它转换成mm:dd:yy formate。

...........

kamill

I have a timestamp type field into my mysql database table. Now threw php i need to change it into mm:dd:yy formate.Threw witch function i can do it. Please help me with an examole. suppose timestamp is this 20070209162211 then how can i convert it into mm:dd:yy formate.
...........
kamill

推荐答案

date(" d / m / Y",
date( "d/m/Y",


unix_timestamp);


但是20070209162211它不是unix时间戳。

unix时间戳是从1970年开始的秒数
unix_timestamp);

but 20070209162211 it isn''t unix timestamp.
unix timestamp is a number of seconds from 1970 year


20070209162211是

2007-02-09 16:22:11


转换起来更简单。使用substr()及其全部
20070209162211 is
2007-02-09 16:22:11

it''s more simple to convert. split this string by symbols using substr() and its all


这篇关于如何将时间戳转换为mm:dd:yy格式。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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