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:[mathdate]{12/31/97}+{[MATH][Number_of_Months]%12[/MATH]/00/[MATH]FLOOR([Number_of_Months]/12)[/MATH]}[/math]This would make sure that any number of months was converted into theproper number of years and the remaining months.MichaelMichael Winston *By Phone!: (503)/652/8815 x341Internet Coordinator *By e-mail!: michaelw@dhorse.comDark Horse Comics, Inc. *By web!: http://www.dhorse.com/
Associated Messages, from the most recent to the oldest:
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:[mathdate]{12/31/97}+{
[math][Number_of_Months]%12[/MATH]/00/
[math]FLOOR([Number_of_Months]/12)[/MATH]}[/math]This would make sure that any number of months was converted into theproper number of years and the remaining months.MichaelMichael Winston *By Phone!: (503)/652/8815 x341Internet Coordinator *By e-mail!: michaelw@dhorse.comDark 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)