Re: Adding a month and the 31st (bug?)
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 42056
interpreted = N
texte = Matthew Bohne wrote:> Slight problem. Here's the code:> > [format days_to_date %m/%Y][math]{[date]}+{00/00/0000}[/math][/format]> [format days_to_date %m/%Y][math]{[date]}+{01/00/0000}[/math][/format]> Actually, this has little to do with the current day being the 31st; you would also have problems with February for January 29, 30, 31. The issue is you are incrementing the month number for the current date, but the following month doesn't have that many days, so the [format days_to_date] moves it into the following month. In other words: 07/31/2002 + 01/00/00 = 08/31/2002 => 09/01/2002Do somthing like this instead (not inside an [orderfile] context): [math date]thismonth=[format days_to_date %m/01/%Y]{[date]}[/math] [format days_to_date %m/%Y][math]{[thismonth]}+{00/00/0000}[/math][/format] [format days_to_date %m/%Y][math]{[thismonth]}+{01/00/0000}[/math][/format]so that [thismonth] will always be the first day of the current month.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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:
Matthew Bohne wrote:> Slight problem. Here's the code:> > [format days_to_date %m/%Y][math]{[date]}+{00/00/0000}[/math][/format]> [format days_to_date %m/%Y][math]{[date]}+{01/00/0000}[/math][/format]> Actually, this has little to do with the current day being the 31st; you would also have problems with February for January 29, 30, 31. The issue is you are incrementing the month number for the current date, but the following month doesn't have that many days, so the [format days_to_date] moves it into the following month. In other words: 07/31/2002 + 01/00/00 = 08/31/2002 => 09/01/2002Do somthing like this instead (not inside an [orderfile] context): [math date]thismonth=[format days_to_date %m/01/%Y]{[date]}[/math] [format days_to_date %m/%Y][math]{[thismonth]}+{00/00/0000}[/math][/format] [format days_to_date %m/%Y][math]{[thismonth]}+{01/00/0000}[/math][/format]so that [thismonth] will always be the first day of the current month.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------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 Peacock
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:
Public beta 5 of WebCatalog 4.0 is now available (2000)
using showpage and showcart commands (1996)
docs for WebCatalog2 (1997)
[WebDNA] Needing Open Source Support (2012)
WebCatalog f2 Installation (1997)
[WebDNA] Installation problem (Debian 6 64bit + Lighttpd) (2011)
[WebDNA] Still having problems (2008)
OFF TOPIC - sendmail problem (2003)
Webcat 2.0.1 date math bug -> Crash! (1997)
email program problem (1998)
[WebDNA] TcpConnect Help (2011)
Netscape 3.01 can't see db in form (was problems problemsproblems) (1997)
[WebDNA] SMS Gateway (2013)
2.0.1 new commands and contexts (1997)
problems with 2 tags (1997)
WebCat b13 CGI -shownext- (1997)
Happy Holidays! (1998)
Probably a very simple question? (1997)
Random Images (2000)
Proposed FormVariables hierarchy (2000)