Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting unix dates in Excel

33 views
Skip to first unread message

Robert Vissers

unread,
Sep 25, 2001, 1:38:36 PM9/25/01
to
I regularly get files from different people within our organisation from a
Unix environment. The date is given as the number of seconds form
1-jan-1970. Does somebody have a function to convert this to a normal in
Excel?


J.E. McGimpsey

unread,
Sep 25, 2001, 2:05:23 PM9/25/01
to
Try:

A1: = (number of seconds)
A2: = DATE(1970, 1, 1) + (A1/24/60/60)

or

A2: = DATE(1970,1,1) + A1/86400

If you want a UDF:

Public Function UNIXtoXL(UTime As Double) As Date
Const CONVERT = 86400 'days to seconds
Dim adj1904 As Double
If ActiveWorkbook.Date1904 Then adj1904 = 1462
UNIXtoXL = DateSerial(1970, 1, 1) + UTime / CONVERT - adj1904
End Function

In article <9oqf3s$sptl$1...@reader01.wxs.nl>,
"Robert Vissers" <robert....@planet.nl> wrote:

--
J.E. McGimpsey ar...@zptvzcfrl.pbz
ROT13 encoding, decode for real mail

Robert Vissers

unread,
Sep 26, 2001, 4:20:11 PM9/26/01
to
Works like a dream thanx

"J.E. McGimpsey" <ar...@zptvzcfrl.pbz> schreef in bericht
news:arjf-F220AD.1...@msnews.microsoft.com...

0 new messages