开发者

Convert decimal/hexdecimal number to timestamp in C

开发者 https://www.devze.com 2023-02-20 13:15 出处:网络
I can read values of elapsed seconds since some reference time which appears in the format 1301330553(Decimal)/4D90BA79(hex). I would like to convert these seconds in some date/time format in C.

I can read values of elapsed seconds since some reference time which appears in the format 1301330553(Decimal)/4D90BA79(hex). I would like to convert these seconds in some date/time format in C. T开发者_如何转开发he elapsed seconds mentioned above are of u32 data type.


there's a function called ctime which takes a unix long as a parameter that renders the time in ascii.


Assuming you are talking about 32 bit linux time then you may want to use the gmtime function.

If you want it as a string you can use asctime to convert it to a nice readable format.

If its not linux time then give us more details!!

0

精彩评论

暂无评论...
验证码 换一张
取 消