Re: Date subtraction

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 44262
interpreted = N
texte = If you use the first method I suggested that's all taken care of - the date routines do follow the 100 and 400 year conditions. Your code should work well into the next millenium.>and remember a year is a leap year > >IF it is evenly divisible by 4 >UNLESS it is evenly divisible by 100 >UNLESS it is evenly divisible by 400 > >So, 1996 was a leap year because it was evenly divisible by 4 >2000 is because it is divisible by 400 even though it is divisible by 100 >2100 although divisible by 4 is not a leap year. 2400 is. > >So, I just use > >[showif [date %Y]\4][text show=f]leapyear=leap[/text][/showif] >[showif [date %Y]\100][text show=f]leapyear=noleap[/text][/showif] >[showif [date %Y]\400][text show=f]leapyear=leap[/text][/showif] > >[search db=^calendardbs/[leapyear].db&eqmonthdatarq=[date %m]... > >and have two dbs leap.db and noleap.db with the number of days for each month. > >-- >Matthew C. Bohne >Web Developer >Sandusky Register >314 W. Market St. >Sandusky, OH 44870 >419-625-5500 ext. 253 >matthewbohne@sanduskyregister.com >http://www.sanduskyregister.com > >On Monday, October 21, 2002 2:27 PM, Rob Marquardt wrote: >>on 10/21/02 9:56 AM, John Hill at johnh@genericaddress.com so >>noted... >> >>> I should mention that another clean way to do the days of month problem is to >>> create a database with the month and the days of month. Then use [date %m] to >>> lookup the days of month. >> >>Don't forget coding to handle February in leap years. : ) >> >> >>Rob Marquardt >>Designer/Resident Wirehead >>Toast Design >> >>800 Washington Avenue North >>Minneapolis MN 55401 >>612.330.9863 v >>612.321.9424 f >>www.toastdesign.com >> >> >>------------------------------------------------------------- >>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://search.smithmicro.com/ >> > > > >------------------------------------------------------------- >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://search.smithmicro.com/-- --------------------------------- John A. Hill Oak Hill Software Website Development/Consulting john@oakhillsoftware.com------------------------------------------------------------- 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Date subtraction (Alain Russell 2002)
  2. Re: Date subtraction (John Hill 2002)
  3. Re: Date subtraction (Matthew Bohne 2002)
  4. Re: Date subtraction (John Hill 2002)
  5. Re: Date subtraction (Rob Marquardt 2002)
  6. Re: Date subtraction (John Hill 2002)
  7. Re: Date subtraction (NovaDerm Skincare Science 2002)
  8. Re: Date subtraction (John Hill 2002)
  9. Re: Date subtraction (NovaDerm Skincare Science 2002)
  10. Re: Date subtraction (Alain Russell 2002)
  11. Re: Date subtraction (NovaDerm Skincare Science 2002)
  12. Re: Date subtraction (Alain Russell 2002)
  13. Re: Date subtraction (NovaDerm Skincare Science 2002)
  14. Re: Date subtraction (NovaDerm Skincare Science 2002)
  15. Re: Date subtraction (Alain Russell 2002)
  16. Re: Date subtraction (Gary Krockover 2002)
  17. Re: Date subtraction (Alain Russell 2002)
  18. Date subtraction (NovaDerm Skincare Science 2002)
If you use the first method I suggested that's all taken care of - the date routines do follow the 100 and 400 year conditions. Your code should work well into the next millenium.>and remember a year is a leap year > >IF it is evenly divisible by 4 >UNLESS it is evenly divisible by 100 >UNLESS it is evenly divisible by 400 > >So, 1996 was a leap year because it was evenly divisible by 4 >2000 is because it is divisible by 400 even though it is divisible by 100 >2100 although divisible by 4 is not a leap year. 2400 is. > >So, I just use > >[showif [date %Y]\4][text show=f]leapyear=leap[/text][/showif] >[showif [date %Y]\100][text show=f]leapyear=noleap[/text][/showif] >[showif [date %Y]\400][text show=f]leapyear=leap[/text][/showif] > >[search db=^calendardbs/[leapyear].db&eqmonthdatarq=[date %m]... > >and have two dbs leap.db and noleap.db with the number of days for each month. > >-- >Matthew C. Bohne >Web Developer >Sandusky Register >314 W. Market St. >Sandusky, OH 44870 >419-625-5500 ext. 253 >matthewbohne@sanduskyregister.com >http://www.sanduskyregister.com > >On Monday, October 21, 2002 2:27 PM, Rob Marquardt wrote: >>on 10/21/02 9:56 AM, John Hill at johnh@genericaddress.com so >>noted... >> >>> I should mention that another clean way to do the days of month problem is to >>> create a database with the month and the days of month. Then use [date %m] to >>> lookup the days of month. >> >>Don't forget coding to handle February in leap years. : ) >> >> >>Rob Marquardt >>Designer/Resident Wirehead >>Toast Design >> >>800 Washington Avenue North >>Minneapolis MN 55401 >>612.330.9863 v >>612.321.9424 f >>www.toastdesign.com >> >> >>------------------------------------------------------------- >>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://search.smithmicro.com/ >> > > > >------------------------------------------------------------- >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://search.smithmicro.com/-- --------------------------------- John A. Hill Oak Hill Software Website Development/Consulting john@oakhillsoftware.com------------------------------------------------------------- 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://search.smithmicro.com/ John Hill

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:

SMTP Mail Server (2003) My new discussion forum (2003) webcat list slow? (1998) ReplaceFoundItems (2006) WebTEN vs webSTAR (1998) How to search dbs across virtual hosts for same domain? (2003) Dummy Credit Card Number for debug? (1997) Couple of questions (1999) [WebDNA] WebDNA Roll Call (2013) Execute Applescript (1997) Prices Dropped (1998) summ=T (2003) Review comparison by PC Magazine: Open for On-line Business (1997) Grepping text variable tags (was: No subject given) (2000) [shownext] and descending order (1997) My slower response (1997) WebCatb15 Mac CGI -- [purchase] (1997) WebDNA 4.5.1 Now Available [OT] (2003) Document Contains no data, or showcart error. (1997) Sherlock and WebCat-2 (1998)