date_leap_year

Returns whether the year in the given datetime is a leap year or not.

Syntax:

GML Code Example

date_leap_year(date);


Argument Description
date The datetime to use.


Returns: Boolean


Description

This function will return true if the year component of the given datetime value is a leap year or false otherwise. This can be a handy function for things like Easter Eggs in your games, or for unlocking special content.


Example:

GML Code Example

if date_leap_year(date_current_datetime())
    {
    if !global.ExtraContent
       {
       global.ExtraContent = true;
       }
    }
 

The above code will check the current datetime to see if the year is a leap year or not. If it is it sets a global variable.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here