calculating unique time

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 18232
interpreted = N
texte = That is not the problem we originally talked about, therefore the new subject.At 13:01 Uhr 13.06.1998, bob wrote: You set the login time of a user like this: >logintime=[math]{{[time]}+{00:20:00}}+{[date]}[/math] Hmm... I don't think this will be reliable under any circumstances: [math]{date}[/math] returns the number of days since 00/00/000. [math]{time}[/math] returns the seconds since midnight. If you just add the two values, the result will merely depend on the seconds since midnight: Assume we have 729918 days and 64255 seconds now, we get 729918 days + 64255 seconds = 794173 Tomorrow we have 729919 days and let's say 20000 seconds: 729919 days + 20000 seconds = 749919 Effect: the time of tomorrow is older than the value of today! In fact any hit tomorrow which occures before the corresponding today's time will be lower - that is important if the user works around midnight...And here a never-can-be-example ;-) a user logs in today: 729918 days + 64255 seconds = 794173 and tomorrow, one second before he did today: 729919 days + 64254 seconds = 794173 Effect: the two results are identical, but there is actually one day difference! Since WebCat has no (short) function to calculate seconds since the date 00/00/0000, I do some sort of digit-shift to get reliable values:> currenthit=[math]{[date]}[/math]*100000 > +[math]{[time]}[/math][/math] (In clear text: days * 100000 + seconds)For example, a login today: 729918 * 100000 = 72991800000 + 64255 = 729918064255 and a login tomorrow, same time: 729919 * 100000 = 72991900000 + 64255 = 729919064255 Effect: tomorrows value is always higher than today's. Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Associated Messages, from the most recent to the oldest:

    
  1. Re: calculating unique time (bob 1998)
  2. calculating unique time (Peter Ostry 1998)
That is not the problem we originally talked about, therefore the new subject.At 13:01 Uhr 13.06.1998, bob wrote: You set the login time of a user like this: >logintime=[math]{{[time]}+{00:20:00}}+{[date]}[/math] Hmm... I don't think this will be reliable under any circumstances: [math]{date}[/math] returns the number of days since 00/00/000. [math]{time}[/math] returns the seconds since midnight. If you just add the two values, the result will merely depend on the seconds since midnight: Assume we have 729918 days and 64255 seconds now, we get 729918 days + 64255 seconds = 794173 Tomorrow we have 729919 days and let's say 20000 seconds: 729919 days + 20000 seconds = 749919 Effect: the time of tomorrow is older than the value of today! In fact any hit tomorrow which occures before the corresponding today's time will be lower - that is important if the user works around midnight...And here a never-can-be-example ;-) a user logs in today: 729918 days + 64255 seconds = 794173 and tomorrow, one second before he did today: 729919 days + 64254 seconds = 794173 Effect: the two results are identical, but there is actually one day difference! Since WebCat has no (short) function to calculate seconds since the date 00/00/0000, I do some sort of digit-shift to get reliable values:> currenthit=[math]{[date]}[/math]*100000 > +[math]{[time]}[/math][/math] (In clear text: days * 100000 + seconds)For example, a login today: 729918 * 100000 = 72991800000 + 64255 = 729918064255 and a login tomorrow, same time: 729919 * 100000 = 72991900000 + 64255 = 729919064255 Effect: tomorrows value is always higher than today's. Peter__________________________________________ Peter Ostry - po@ostry.com - www.ostry.com Ostry & Partner - Ostry Internet Solutions Auhofstrasse 29 A-1130 Vienna Austria fon ++43-1-8777454 fax ++43-1-8777454-21 Peter Ostry

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:

Secure server question (1997) NEW NetProfessional Revealed (1998) problem: search crashes webstar (1997) Cache headers - WebDNA 5 (2005) Exclamation point (1997) HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997) listing certain items in the orderfile (2002) WCS Newbie question (1997) WebCat2_Mac RETURNs in .db (1997) Mac webcatalog3_0_5b11 more dead lock throws (1999) Browser Reloads and AddlineItem (1997) WebDNA 4.5 not starting on boot? (2002) [searh] or [shownext]problem (1998) Preventing code execution (2003) Hello??? (1997) Need WebDNA that crashes server for testing (2000) Available Server Space? (2004) [WebDNA] possible bug? (db field named [width]) (2012) Need help... (1997) PSC recommends what date format yr 2000??? (1997)