Re: Calculating days, hours, minutes ago - SOLUTION

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57532
interpreted = N
texte = For the record: [text show=f]pdate=04/25/2004[/text] [text show=f]ptime=10:25:12[/text] Post Date: [pdate]
Post Time: [ptime]
current date: [date]
current time: [time]

seconds_since: [text show=T]seconds_since=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time])[/math])[/math][/text]
old_seconds_since: [text show=T]old_seconds_since=[math]((([math]{[pdate]}[/math])-1)*86400)+([math]{[ptime])[/math])[/math][/text]
diff: [text show=T]diff=[math][seconds_since]-[old_seconds_since][/math][/text]

[text show=f]diff=[diff][/text] [math show=f]seconds=0[/math] [math show=f]hours=0[/math] [math show=f]minutes=0[/math] [showif [math][diff]%86400[/math]<1] [text show=f]days=[math][diff]/86400[/math][/text] [/showif] [showif [math][diff]%86400[/math]>0] [text show=f]rest=[math][diff]%86400[/math][/text] [text show=f]days=[math]([diff]-[rest])/86400[/math][/text] [if ([math][rest]%3600[/math]>0)] [then] [text show=f]rest1=[math][rest]%3600[/math][/text] [text show=f]hours=[math]([rest]-[rest1])/3600[/math][/text] [if ([math][rest1]%60[/math]>0)] [then] [text show=f]rest2=[math][rest1]%60[/math][/text] [text show=f]minutes=[math]([rest1]-[rest2])/60[/math][/text] [text show=f]seconds=[rest2][/text] [/then] [else] [text show=f]minutes=[math][rest1]/60[/math][/text] [/else] [/if] [/then] [else] [text show=f]hours=[math][rest]/3600[/math][/text] [/else] [/if] [/showif]
[days] days, [hours] hours, [minutes] minutes, [seconds] seconds ago ------------------------------------------------------------- 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 - SOLUTION ( Gary Krockover 2004)
For the record: [text show=f]pdate=04/25/2004[/text] [text show=f]ptime=10:25:12[/text] Post Date: [pdate]
Post Time: [ptime]
current date: [date]
current time: [time]

seconds_since: [text show=T]seconds_since=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time])[/math])[/math][/text]
old_seconds_since: [text show=T]old_seconds_since=[math]((([math]{[pdate]}[/math])-1)*86400)+([math]{[ptime])[/math])[/math][/text]
diff: [text show=T]diff=[math][seconds_since]-[old_seconds_since][/math][/text]

[text show=f]diff=[diff][/text] [math show=f]seconds=0[/math] [math show=f]hours=0[/math] [math show=f]minutes=0[/math] [showif [math][diff]%86400[/math]<1] [text show=f]days=[math][diff]/86400[/math][/text] [/showif] [showif [math][diff]%86400[/math]>0] [text show=f]rest=[math][diff]%86400[/math][/text] [text show=f]days=[math]([diff]-[rest])/86400[/math][/text] [if ([math][rest]%3600[/math]>0)] [then] [text show=f]rest1=[math][rest]%3600[/math][/text] [text show=f]hours=[math]([rest]-[rest1])/3600[/math][/text] [if ([math][rest1]%60[/math]>0)] [then] [text show=f]rest2=[math][rest1]%60[/math][/text] [text show=f]minutes=[math]([rest1]-[rest2])/60[/math][/text] [text show=f]seconds=[rest2][/text] [/then] [else] [text show=f]minutes=[math][rest1]/60[/math][/text] [/else] [/if] [/then] [else] [text show=f]hours=[math][rest]/3600[/math][/text] [/else] [/if] [/showif]
[days] days, [hours] hours, [minutes] minutes, [seconds] seconds ago ------------------------------------------------------------- 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:

Extended [ConvertChars] (1997) WebCat2b15MacPlugin - [protect] (1997) RE: Going to anchors within a template page (1997) RE: type 2 errors with ssl server (1997) Re:Change WebDNA-Talk Mail due to no digest for 1wk (1997) Here we go again...WebDNA - SQL- Stored Procedures (2006) WebCommerce: Folder organization ? (1997) RequiredFields template (1997) creating a ShipCosts database (1997) Database Posting (2000) Globals Problem and now can't close databases (2003) [WebDNA] IIS 7.5 (2015) For those of you not on the WebCatalog Beta... (1997) Ok here is a question? (1997) Re:PCS Customer submissions ? (1997) WebCat2b12 - New features for 1.6 users ... (1997) Single Link browsing (1997) Problems getting parameters passed into email. (1997) TEXT Variable (2003) japanese characters (1997)