Re: Date math

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 15289
interpreted = N
texte = At 2:40 PM -0800 12/1/97, Dan L Gilpin is rumored to have typed: > The following date math... > [math date]{12/31/97}+{13/00/0000}[/math] > results in... > 12/31/1997 > Adding any month number above 12 breaks. Is there a way around this, > other than using a loop?You could just change it to: [math date]{12/31/97}+{1/00/1}[/math], but it seems like you're using this to pass a variable of some sort (say, [Number_Of_Months]).I would use: [math date]{12/31/97}+{[MATH][Number_of_Months]%12[/MATH]/00/[MATH]FLOOR([Number_of_Mo nths]/12)[/MATH]}[/math] This would make sure that any number of months was converted into the proper number of years and the remaining months.MichaelMichael Winston *By Phone!: (503)/652/8815 x341 Internet Coordinator *By e-mail!: michaelw@dhorse.com Dark Horse Comics, Inc. *By web!: http://www.dhorse.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Date Math broken on Mac OS X 10.4? ( Tom Duke 2007)
  2. Re: Date Math broken on Mac OS X 10.4? ( Paul Willis 2007)
  3. Re: Date Math broken on Mac OS X 10.4? ( Tom Duke 2007)
  4. Date Math broken on Mac OS X 10.4? ( Paul Willis 2007)
  5. Re: Date Math ( Patrick McCormick 2005)
  6. Re: date math ( Donovan Brooke 2005)
  7. Re: date math ( Dave Hurley 2005)
  8. Re: Date Math ( Donovan Brooke 2005)
  9. Re: Date Math ( "Allen" 2005)
  10. Date Math ( Eddie Z 2005)
  11. Re: date math [2.x] (Aaron Lynch 1999)
  12. Re: date math [2.x] (PCS Technical Support 1999)
  13. Re: date math [2.x] (Marty Schmid 1999)
  14. date math [2.x] (Aaron Lynch 1999)
  15. Re: Date Math (Kenneth Grome 1999)
  16. Re: Date Math (Will Starck 1999)
  17. Date Math (Jason Tyler 1999)
  18. Re: Date math format (PCS Technical Support 1998)
  19. Date math format (bob 1998)
  20. Re: Date Math bug (Dale LaFountain 1998)
  21. Re: Date Math bug (John Hill 1998)
  22. Date Math bug (Michael Winston 1998)
  23. Re: Date math (Michael Winston 1997)
  24. Date math (Dan L Gilpin 1997)
  25. Re: Webcat 2.0.1 date math bug -> Crash! (wahl@dnai.com (Bernt Wahl) 1997)
  26. Re: Webcat 2.0.1 date math bug -> Crash! (Kenneth Grome 1997)
  27. Webcat 2.0.1 date math bug -> Crash! (Dale LaFountain 1997)
  28. Problems with date math (Michael Winston 1997)
  29. Re: Problems with date math (Olin 1997)
  30. Re: Problems with date math (Grant Hulbert 1997)
At 2:40 PM -0800 12/1/97, Dan L Gilpin is rumored to have typed: > The following date math... > [math date]{12/31/97}+{13/00/0000}[/math] > results in... > 12/31/1997 > Adding any month number above 12 breaks. Is there a way around this, > other than using a loop?You could just change it to: [math date]{12/31/97}+{1/00/1}[/math], but it seems like you're using this to pass a variable of some sort (say, [Number_Of_Months]).I would use: [math date]{12/31/97}+{[math][Number_of_Months]%12[/MATH]/00/[math]FLOOR([Number_of_Mo nths]/12)[/MATH]}[/math] This would make sure that any number of months was converted into the proper number of years and the remaining months.MichaelMichael Winston *By Phone!: (503)/652/8815 x341 Internet Coordinator *By e-mail!: michaelw@dhorse.com Dark Horse Comics, Inc. *By web!: http://www.dhorse.com/ Michael Winston

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:

So what ya working on? (or have you completed?) (2004) Item counting? (1998) Word Breaks (1998) [LOOKUP] (1997) Show if time tags (1997) WebCat2 several catalogs? (1997) normal users.db calls ... (1998) WebStar Questions ... (2000) Erotic Sites (1997) Emailer (1997) How to get shownext to just shownext once (1997) Urgent Help needed (1998) Summing fields (1997) WebCatalog for Dummies part 2 (2000) CSS in HTML emails? (2003) off topic - dna snipets (1997) Problems with cybercash (2000) WARNING: MacOS The installer is broken... (2000) using showpage and showcart commands (1996) [lookup] speed sales pitch (2003)