randallf Posted April 9, 2009 Report Share Posted April 9, 2009 Hello! I have been writing macros for awhile, some of them have to do with time. Anything I have written for time is a MONSTER of a function for something that I feel should be much simpler... Here is my timestamp: 04/08/2009 09:23:43 AM I need to be able to just grab that stamp and tell numerically how many hours have passed since that time. I have at least two functions that I think will acomplish the task but after reading a lot of others work (and because I generally am self-taught with nobody to compare notes with locally) I think that there are probably better ways. So, most divine ME3 gurus: What is the best way to tell how many hours and minutes have passed since 04/08/2009 09:23:43 AM using ME3? -Rand Quote Link to comment Share on other sites More sharing options...
randallf Posted April 9, 2009 Author Report Share Posted April 9, 2009 As an afterthought since I am already using excel to track some of this data I may just use an excel formula to do this rather than ME. Quote Link to comment Share on other sites More sharing options...
stevecasper Posted April 9, 2009 Report Share Posted April 9, 2009 As an afterthought since I am already using excel to track some of this data I may just use an excel formula to do this rather than ME. That may actually be best. ME Pro has a grander Date/Time functionality, and even it is tragically lacking in this department. However, Cory (regular poster and serious macro genius) knows a lot about Date/Time calculations in ME, and he has some work-around information he could get you... but it would be for use with ME Pro rather than ME 3. Quote Link to comment Share on other sites More sharing options...
monpasdg Posted May 9, 2009 Report Share Posted May 9, 2009 As an afterthought since I am already using excel to track some of this data I may just use an excel formula to do this rather than ME. If your going to use excel you would need to do the following: Create a cell with this Function =now() Using both the time stamp and that function cell, create two cell that multiply them by 24 (puts those times into hours) =A1*24 =A2*24 Then the difference between the Now() cell and the time stamp will be in hours. You can make this easily into days, minutes and seconds as well. Days: Remove *24 mulitplication Minutes: Use A1*24*60 Seconds: Use A1*24*60*60 I attached a screen shot to show this better. Quote Link to comment Share on other sites More sharing options...
monpasdg Posted May 9, 2009 Report Share Posted May 9, 2009 Oh I forgot to put the single cell formula (I hate doing cross column formulas) This would get rid of the extra cells and you can just have one column for cleaner results A1 is just where the time stamp is. =NOW()*24-A1*24 If you do this formula and it has a result that looks like the time stamp, just format the cell to a number Cheers, -Don Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.