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:
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)