Unix中字符串到字符串的时间 [英] Unix time in string to string

查看:86
本文介绍了Unix中字符串到字符串的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有unix时间关注
string str=1230728833;
我想将str转换为字符串的日期时间格式..
请帮助....

Hi I have the unix time follwing
string str=1230728833;
I want to convert str to the date time format of string..
Please help....

推荐答案

Unix/Linux时间戳是自格林尼治标准时间1970年1月1日午夜以来的秒数(称为时代).通过编程,它们比日期/时间字符串容易得多.

查看此处提供的源代码: wiki上的time_t
Unix/Linux timestamps are the number of seconds since midnight, January 1, 1970 GMT (referred to as the Epoch). They are much easier to programmatically manipulate than date/time strings.

Look at the source code given here : time_t on wiki


使用ctime函数. http://www.cplusplus.com/reference/clibrary/ctime/ [
use ctime function. http://www.cplusplus.com/reference/clibrary/ctime/[^]


这篇关于Unix中字符串到字符串的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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