将Unix时间戳转换为dd / mm / yyyy hh:mm:ss [英] Converting Unix time stamp to dd/mm/yyyy hh:mm:ss

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

问题描述

我有一个列在C1上保存Unix时间戳,我正在寻找公式来创建一个新的列,将时间戳记转换为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屋!

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