Prev: Archiving
Next: Problems shelling another application
From: Dimitri Kowaletschew on 16 Dec 2009 10:12 Hello! Does anybody know how to convert a Unix timestamp to a VB date/time? Thanks very much!! Dimi
From: Rick Rothstein on 16 Dec 2009 10:44 I think you can use this... VBdate = DateAdd("s", UnixTimeStamp, #1/1/1970#) where you would assign your Unix timestamp to the indicated variable. -- Rick (MVP - Excel) "Dimitri Kowaletschew" <dimi.k(a)yahoo.com> wrote in message news:OtPv3ImfKHA.5300(a)TK2MSFTNGP02.phx.gbl... > Hello! > > Does anybody know how to convert a Unix timestamp to a VB date/time? > > Thanks very much!! > Dimi
From: Dee Earley on 17 Dec 2009 04:34 On 16/12/2009 15:44, Rick Rothstein wrote: > I think you can use this... > > VBdate = DateAdd("s", UnixTimeStamp, #1/1/1970#) > > where you would assign your Unix timestamp to the indicated variable. It's not that simple last I looked as we are currently dealing with numbers that have rolled over into negative values (using VBs signed longs) It shoudl be possible, but I never got code working properly as I just asked my colleague to change the format to a more VB friendly value :) -- Dee Earley (dee.earley(a)icode.co.uk) i-Catcher Development Team iCode Systems
From: Ralph on 17 Dec 2009 07:22 "Dee Earley" <dee.earley(a)icode.co.uk> wrote in message news:%23rbHQtvfKHA.5300(a)TK2MSFTNGP02.phx.gbl... > On 16/12/2009 15:44, Rick Rothstein wrote: > > I think you can use this... > > > > VBdate = DateAdd("s", UnixTimeStamp, #1/1/1970#) > > > > where you would assign your Unix timestamp to the indicated variable. > > It's not that simple last I looked as we are currently dealing with > numbers that have rolled over into negative values (using VBs signed longs) > > It shoudl be possible, but I never got code working properly as I just > asked my colleague to change the format to a more VB friendly value :) > Many "Unix Timestamps" are GMT So you need to go piddle with time zones as well. http://www.trap17.com/index.php/Converting-Unix-Timestamp_t20240.html Also as a minor warning to the OP, within any shop that is using "unix" with other services such as Oracle or PHP there may be a common critter everyone is passing around calling a "Unix TimeStamp", but in reality it might be based one of several established "Time" formats. Always ask before going off and making assumptions, can save a lot of *time*. <g> -ralph
From: Jeff Johnson on 17 Dec 2009 12:27
"Ralph" <nt_consulting64(a)yahoo.com> wrote in message news:uCEc6PxfKHA.1652(a)TK2MSFTNGP05.phx.gbl... > Also as a minor warning to the OP, within any shop that is using "unix" > with > other services such as Oracle or PHP there may be a common critter > everyone > is passing around calling a "Unix TimeStamp", but in reality it might be > based one of several established "Time" formats. Always ask before going > off > and making assumptions, can save a lot of *time*. <g> <Rimshot> |