Re: Testing for leap year?

Author: Sytze de Boer

Posted: 2011-04-12 at 17:53:00

mdate=CTOD("15/2/2011")

ldate=Gomonth(mdate - Day(mdate) + 1, 1) - 1

it will return either 28 or 29

On Wed, Apr 13, 2011 at 9:48 AM, MB Software Solutions, LLC <

mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:

> How do you test to see if it's a leap year? The first thing that comes

> to my mind is checking to see if DATE(nCurrentYearVariable,2,29) throws

> an error or not. e.g.

>

> dDate = DATE(nCurrentYearVariable,2,29)

> lLeapYear = not empty(dDate)

>

> Better ideas?

>

> --

> Mike Babcock, MCP

> MB Software Solutions, LLC

> President, Chief Software Architect

> http://mbsoftwaresolutions.com

> http://fabmate.com

> http://twitter.com/mbabcock16

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/BANLkTik3XH2Q=m+Rp9Z3J2-djmTeo=B5hQ@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2011 Sytze de Boer