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 Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 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:

    
  1. Re: Adding a month and the 31st (bug?) (John Peacock 2002)
  2. Re: Adding a month and the 31st (bug?) (John Peacock 2002)
  3. Re: Adding a month and the 31st (bug?) (Matthew Bohne 2002)
  4. Re: Adding a month and the 31st (bug?) (John Peacock 2002)
  5. Adding a month and the 31st (bug?) (Matthew Bohne 2002)
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 Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4720 Boston Way Lanham, MD 20706 301-459-3366 x.5010 fax 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:

[WebDNA] XML Help please (2009) locking variables? (2000) Unsubscribe me (2001) PIXO (1997) I'm new (2001) Speed Optimization - Mac (1997) shipcost (1997) Kaaaaahhhhhhhnnnnnnn! (1997) ConvertChars? (1998) How to find 100 most recent additions. (1997) Correction: New WebDNA Example from Olin -- (1998) spaces in db (2001) [WebDNA] File Upload Problem (2009) won't serve .tpl (2000) Only charge card when product shipped ? (1997) Orders w/in [sendmail] (1998) price formula (1999) Has anyone used WebCatalog with CGatePro? (2000) WebCatalog NT beta 18 problem (1997) WebCat virtual postcard is done! Thanks for the help! (1998)