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:

WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) writefile - continued (1997) Using the sendmail command on CGate Pro (Unix) (2000) Need relative path explanation (1997) Search crashing server (1998) Problem displaying search result (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Protect vs Authenicate (1997) Merging databases (1997) License for Sale? (2003) Multiple security dbs (1997) WebCat2: Items xx to xx shown, etc. (1997) Active Server Code... (1998) Smart caching problems with 2.1b3? (1997) Add a field to the error log? (1997) Encrypt/decrypt bug in 3.0.5b12 (1999) Sorting by type=date (1999) [OT] Ave. Hits Per Day (2006) IE4.5 bug FYI (1999) Lookup Notfound (1998)