将Unix时间戳转换为dd / mm / yyyy hh:mm:ss [英] Converting Unix time stamp to dd/mm/yyyy hh:mm:ss
问题描述
以下是时间戳的示例:
1409502202
您将不得不提供从UNIX(又名POSIX)时间戳到Excel日期的一些转换格式。通常这是通过将时间戳除为86,400(一天中的秒数)和加上25,569(从1900年1月1日至1970年1月1日的天数)来执行的。原始值与Excel日期/时间数字系统同步, TEXT功能可以创建日期/时间。
= text(c1 / 86400 + 25569,dd / mm / yyyy hh:mm:ss)'yield 31/08/2014 16:23:22
I have a column that holds Unix timestamps at C1, and I am looking for the formula to create a new column that converts the timestamp to dd/mm/yyyy hh:mm:ss.
Here is a sample of the timestamp:
1409502202
You are going to have to provide some conversion from the UNIX (aka POSIX) timestamp to an Excel Date format. Typically this is performed by dividing the timestamp by 86,400 (number of seconds in a day) and adding 25,569 (number of days from 01-Jan-1900 to 01-Jan-1970). With a raw value that is in synch with the Excel date/time numerical system, the TEXT function can create the date/time.
=text(c1/86400 + 25569, "dd/mm/yyyy hh:mm:ss") 'yields 31/08/2014 16:23:22
这篇关于将Unix时间戳转换为dd / mm / yyyy hh:mm:ss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!