Jump to content
Macro Express Forums

Time since stamp


randallf

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 weeks later...
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.

post-4204-1241888648_thumb.jpg

post-4204-1241888655_thumb.jpg

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...