Microsoft Office Forums


Reply
Thread Tools Display Modes

Conversion Of Unix Time

 
 
Roy
Guest
Posts: n/a
 
      09-24-2009, 03:41 PM
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

 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      09-24-2009, 04:40 PM
Take a look at this site:

http://www.mcgimpsey.com/excel/udfs/unixtoxltime.html

Hope this helps.

Pete

On Sep 24, 4:41*pm, Roy <praish1...@yahoo.com> wrote:
> 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


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Convert from Unix time to Access Date/Time? John Vinson Access Newsgroup 1 05-11-2006 05:41 PM
Date to Unix time stamp? Newbie Excel Newsgroup 2 07-20-2005 11:19 PM
Excel Date Time to Unix Time jnorton Excel Newsgroup 2 05-24-2005 05:04 PM
Convert UNIX time to normal cwalker123 Excel Newsgroup 1 11-03-2004 06:15 PM
Unix Date Conversion Lynn Access Newsgroup 1 07-15-2003 01:53 AM



All times are GMT. The time now is 04:29 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92