date_leap_year

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

Syntax:

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:

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.


Back: Date And Time
Next: date_minute_span
© Copyright YoYo Games Ltd. 2018 All Rights Reserved