date_is_today

Returns whether the given datetime is today or not.

语法:

date_is_today(date);


参数 描述
date The datetime to use.


返回: 布尔值


描述

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.


例如:

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.


上一页: Date And Time
下一页: date_leap_year
© Copyright YoYo Games Ltd. 2018 All Rights Reserved