Date And Time

This section deals with functions related to dates and time.

GameMaker: Studio has a great many functions and variables related to getting the date and time and calculating other values based off of them. by default these functions return the local time as set by the system, but you can use the following function to switch between local and UTC time:

  1. date_set_timezone
  2. date_get_timezone

Time Variables

The following built in variables can be used to get specific date and time components:

  1. current_time
  2. current_second
  3. current_minute
  4. current_hour
  5. current_day
  6. current_weekday
  7. current_month
  8. current_year

Time Functions

The following functions can be used to get specific date and time components, as well as for creating new ones or for getting the span of days/hours between two given dates etc...

  1. date_create_datetime
  2. date_current_datetime
  3. date_compare_date
  4. date_compare_datetime
  5. date_compare_time
  6. date_valid_datetime
  7. date_date_of
  8. date_time_of
  9. date_is_today
  10. date_leap_year
  11. date_date_string
  12. date_datetime_string
  13. date_time_string
  14. date_second_span
  15. date_minute_span
  16. date_hour_span
  17. date_day_span
  18. date_week_span
  19. date_month_span
  20. date_year_span
  21. date_days_in_month
  22. date_days_in_year
  23. date_get_second
  24. date_get_minute
  25. date_get_hour
  26. date_get_day
  27. date_get_weekday
  28. date_get_week
  29. date_get_month
  30. date_get_year
  31. date_get_second_of_year
  32. date_get_minute_of_year
  33. date_get_hour_of_year
  34. date_get_day_of_year
  35. date_inc_second
  36. date_inc_minute
  37. date_inc_hour
  38. date_inc_day
  39. date_inc_week
  40. date_inc_month
  41. date_inc_year

We also have two special time functions that give you a higher level of precision and control when running your game:

  1. get_timer
  2. delta_time
Back: Reference
© Copyright YoYo Games Ltd. 2018 All Rights Reserved