Calculating days, hours, minutes ago

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57517
interpreted = N
texte = What's the best way to calculate the time difference between 2 dates/times? I have stored in a db, pdate as mm/dd/yyyy and ptime as hh:mm:ss. I'd like to calculate and display the time lapse between the current system date/time and the pdate/ptime as in "posted # days, # hours # minutes ago". I've got some convoluted code where I change the date to days since and subtract those and then subtract the times. The days is no problem, however the hours is a problem if the ptime is a time ahead of the current time. I know this has come up before but the archives are crawling at the moment.... Thanks, GJK ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Calculating days, hours, minutes ago ( Brian Fries 2004)
  2. Re: Calculating days, hours, minutes ago - SOLUTION ( Gary Krockover 2004)
  3. Re: Calculating days, hours, minutes ago ( Gary Krockover 2004)
  4. Re: Calculating days, hours, minutes ago ( "Tom Duke" 2004)
  5. Re: Calculating days, hours, minutes ago ( Donovan Brooke 2004)
  6. Re: Calculating days, hours, minutes ago ( Donovan Brooke 2004)
  7. Re: Calculating days, hours, minutes ago ( Gary Krockover 2004)
  8. Re: Calculating days, hours, minutes ago ( "Tom Duke" 2004)
  9. Re: Calculating days, hours, minutes ago ( Gary Krockover 2004)
  10. Re: Calculating days, hours, minutes ago ( "Sal" 2004)
  11. Calculating days, hours, minutes ago ( Gary Krockover 2004)
What's the best way to calculate the time difference between 2 dates/times? I have stored in a db, pdate as mm/dd/yyyy and ptime as hh:mm:ss. I'd like to calculate and display the time lapse between the current system date/time and the pdate/ptime as in "posted # days, # hours # minutes ago". I've got some convoluted code where I change the date to days since and subtract those and then subtract the times. The days is no problem, however the hours is a problem if the ptime is a time ahead of the current time. I know this has come up before but the archives are crawling at the moment.... Thanks, GJK ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Gary Krockover

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

japanese characters (1997) syntax question, not in online refernce (1997) Shopping Cart Problems (2000) [WebDNA] Different responses for the same commands ... (2011) Running _every_ page through WebCat ? (1997) PCS Customer submissions ? (1997) [OT] ISP Windows program (2005) search for all (1998) extended ASCII with middle command (1999) Nav. 4 probs with cart - Serious problem (1997) japanese characters (1997) Real-Time Credit Card Processing - OnCommerce from OuterNet (1998) multi-paragraph fields (1997) WebCommerce: Folder organization ? (1997) flushdatabases (1997) Template Encryption (1998) Image Sizes (2003) docs for WebCatalog2 (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Math function in Formula.db (1997)