Conversion Of Unix Time

R

Roy

Hi All,

I have a field on my excel report which comes as a UnixTime
(1235502582).I want this to be in Excel readable format for e.g 24-
SEP-2009 21:20.The char is string type

I want to use this in a macro,since affer the data is downloaded,i
want the code to convert.The data is several thousand rows.How would I
make a column reference to call the macro.

If I am using a macro like ,

Public Function UnixTime2DT(lUnixTimeStamp As Long) As Date
UnixTime2DT = DateAdd("s", lUnixTimeStamp, #1/1/1970#)
End Function
how would i call it to a particular column?

I tried to call it as .Column("A").NumberFormat = UnixTime2DT ,but it
did not work
or if I am using this formula,how would I use it in a macro?
(UnixTime/86400) + 25569

Thanks,

Roy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top