[WebDNA] last month's last day expressed as days since 00/00/0000 would be what? (in code)

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101064
interpreted = N
texte = How do I get the last day of last month? I could do the math on the number of days since 00/00/0000 or I could do the math on the {dates} but in both cases I would have to do a lot of conditionals: [if ("[thisMonth]"="[april]") | ("[thisMonth]"="[jun]") | ("[thisMonth]"="[aug]") | ,etc....] [then] [text]ThisMonthsLastDigit=30[/text] [/then] [else] [text]ThisMonthsLastDigit=31[/text] [/else] [/if] [showif [URL][thisMonth][/URL]=feb] [text]ThisMonthsLastDigit=28[/text] [/showif] [if ("[thisYearTYPE]"="[leapyear]") & ("[thisMonth]"="[feb]")] [then] [text]ThisMonthsLastDigit=29[/text] [/then] [/if] and there are deeper cycles, I understand, like every 10th year we skip a leap year, (or something like that), etc. SO I figure it is a waste of time to rewrite the date libraries WebDNA uses. So back to my question: Given that I don't know what month it is now, what WebDNA logic/code do I need to use to figure out whether last month's last day's digit is "28", "29", "30", or "31"? ...and if this is any easier, what I am ultimately after is the exact number (a date "expressed as days since 00/00/0000") of the *first* day of last month, and the *last* day of last month. Thanks for any help! -Govinda Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] last month's last day expressed as days since 00/00/0000 would be what? (in code) (Brian Fries 2008)
  2. [WebDNA] last month's last day expressed as days since 00/00/0000 would be what? (in code) (Govinda 2008)
  3. [WebDNA] last month's last day expressed as days since 00/00/0000 would be what? (in code) (Govinda 2008)
How do I get the last day of last month? I could do the math on the number of days since 00/00/0000 or I could do the math on the {dates} but in both cases I would have to do a lot of conditionals: [if ("[thisMonth]"="[april]") | ("[thisMonth]"="[jun]") | ("[thisMonth]"="[aug]") | ,etc....] [then] [text]ThisMonthsLastDigit=30[/text] [/then] [else] [text]ThisMonthsLastDigit=31[/text] [/else] [/if] [showif [url][thisMonth][/URL]=feb] [text]ThisMonthsLastDigit=28[/text] [/showif] [if ("[thisYearTYPE]"="[leapyear]") & ("[thisMonth]"="[feb]")] [then] [text]ThisMonthsLastDigit=29[/text] [/then] [/if] and there are deeper cycles, I understand, like every 10th year we skip a leap year, (or something like that), etc. SO I figure it is a waste of time to rewrite the date libraries WebDNA uses. So back to my question: Given that I don't know what month it is now, what WebDNA logic/code do I need to use to figure out whether last month's last day's digit is "28", "29", "30", or "31"? ...and if this is any easier, what I am ultimately after is the exact number (a date "expressed as days since 00/00/0000") of the *first* day of last month, and the *last* day of last month. Thanks for any help! -Govinda Govinda

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:

WC2.0 Memory Requirements (1997) webcat plugin issue (2001) Authorize.Net and AIM (2004) Frames and WebCat (1997) RE: [WebDNA] Random Numbers no repeat within a range (2014) server side includes & webcatalog (2000) [BULK] [WebDNA] line/Row Insert (2017) [WebDNA] BBEdit WebDNA Configuration.plist (Language Module) (2013) snicker, snicker (1997) WebMerchant problem (1998) Can you do this??? and other stuff (1997) HELP WITH DATES (1997) Date in IF ELSE Comparison (2004) [WebDNA] Not even sure what to ask for help on. . . :( (2008) OT-Load balance (2004) smithmicro.com website? (2004) faxing orders (2000) RE: Formulas.db + Users.db (1997) Instructions for Digest (1997) Version f1 status (1997)