date_is_today

Returns whether the given datetime is today or not.

Syntax:

GML Code Example

date_is_today(date);


Argument Description
date The datetime to use.


Returns: Boolean


Description

This function will return true if the given datetime value is the day it is being checked on (ie: today), or false otherwise. This can be a handy function for things like Easter Eggs in your games, or for unlocking seasonal content. Note that this function will be affected by the time zone set (default is local time) which you can change using the date_set_timezone() function.


Example:

GML Code Example

if date_is_today(global.Halloween)
    {
    global.Max_Levels = 200;
    }
 

The above code will check the datetime stored in the global variable "Halloween" to see if it is today, and if it is it sets another global variable to a new value.





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