ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unix Time Stamp? (https://www.excelbanter.com/excel-discussion-misc-queries/241032-unix-time-stamp.html)

Mish

Unix Time Stamp?
 
What is forumual to convert a date (example: 8/6/09) to Unix Time Stamp?

Pete_UK

Unix Time Stamp?
 
If your Excel date is in A1, put this in B1:

=(A1-DATE(1970,1,1))*24*60*60

Hope this helps.

Pete

On Aug 28, 6:31*pm, Mish wrote:
What is forumual to convert a date (example: 8/6/09) to Unix Time Stamp?



Ron Rosenfeld

Unix Time Stamp?
 
On Fri, 28 Aug 2009 10:31:02 -0700, Mish
wrote:

What is forumual to convert a date (example: 8/6/09) to Unix Time Stamp?


A Unix timestamp is the number of seconds since 1 Jan 1970 00:00:00 UTC

So to convert any particular date to Unix, you could use:

A1: date to be converted (UTC)

=(A1-DATE(1970,1,1))*86400

Format as General.

Of course, if your date input is in local time, and not UTC, you'd have to
add/subtract the difference from UTC to adjust it. So if local time is UTC - 4
hours, then:

=(A1+4/24-DATE(1970,1,1))*86400
--ron

Mish

Unix Time Stamp?
 
Thanks! Worked Great!


All times are GMT +1. The time now is 03:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com