Re: It it now a leap year?



On Wed, 2007-08-08 at 12:31 -0400, Mike - EMAIL IGNORED wrote:
Is there a system call or variable that will
tell me if it is now a leap year, or should I
do the arithmetic?

Mike.

It's not part of the "standard" set of API calls, but GLib (a library
used by many desktop applications and GTK+ itself for portability and
handling of various data structures) contains a function called
g_date_is_leap_year [1] that may help you in this.

Also, if you're using C++ instead, there is the official GLib C++
wrappers (GLibmm), the Glib::Date::is_leap_year member function will do
the same. Thirdly, Boost has a date_time library whose gregorian type
contains an "is_leap_year" function which also acts similarly.

[1] http://tinyurl.com/2mb24t
[2] http://tinyurl.com/3awun4
[3] http://tinyurl.com/2q4tzn

Hope that helps.
--
Peter Gordon (codergeek42)
GnuPG Public Key ID: 0xFFC19479 / Fingerprint:
DD68 A414 56BD 6368 D957 9666 4268 CB7A FFC1 9479

Attachment: signature.asc
Description: This is a digitally signed message part

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Relevant Pages

  • Re: TDBC documentation, examples, syntax?
    ... This standard is long, ... code, but ISO 9075 contains more than an interface, it defines an SQL ... What I see in the TDBC API is a distinct, ... layer API", this is what we see as we write Tcl programs. ...
    (comp.lang.tcl)
  • Re: TDBC documentation, examples, syntax?
    ... base standard. ... There is no "abstraction" in your API. ... TIP 308 is irrational and unrelated to current database interface ...
    (comp.lang.tcl)
  • Re: Automatically generate variables
    ... strictly conforming programs or use a wider definition. ... I think the standard exists to make people able ... reason why *on-topic* here are only strictly conforming programs. ... C programs, which are C programs even if they use POSIX api, windows ...
    (comp.lang.c)
  • Re: Making class attributes non-case-sensitive?
    ... The application's API is ... I'm not sure if it is standard for Microsoft or just the ... VBScript was the most common scripting language used while anything ... now Python is considered standard. ...
    (comp.lang.python)
  • Re: Automatically generate variables
    ... if the question was "how much of the program is standard C?" ... If the non-standard header has no impact on the rest of the file then only that one line is "pseudo-C crap", if you don't know the contents of the header then the entire presented code can validly be considered as "pseudo-C crap". ... C programs, which are C programs even if they use POSIX api, windows ...
    (comp.lang.c)