O
Ondona
Guest
hey there, im trying to make a script that will check if a time of a given datetime will fall between two other datetimes
the easiest way i figured was using the date_compare_time function but ran into an issue and found out that for some reason it is returning different values depending on if date_set_timezone() is set as timezone_utc or timezone_local
for some reason when i use "timezone_local" both _afterstart and _afterend return 1 instead of afterend returning -1 but using utc it returns correctly
anyone know why this is happening? running on windows 10 (if it matters)
is there any benefit/downside to using utc over local? does date_current_datetime() return different values?
the easiest way i figured was using the date_compare_time function but ran into an issue and found out that for some reason it is returning different values depending on if date_set_timezone() is set as timezone_utc or timezone_local
GML:
date_set_timezone(timezone_local);
var _current = date_create_datetime(current_year, current_month, current_day, 9, 25, 0);
var _start = date_create_datetime(current_year, current_month, current_day, 9, 20, 0);
var _end = date_create_datetime(current_year, current_month, current_day, 11, 30, 0);
var _afterstart = date_compare_time(_current, _start);
var _check1 = date_time_string(_current);
var _check2 = date_time_string(_start);
var _check3 = date_time_string(_end);
var _afterend = date_compare_time(_current, _end);
var _pausehere = 1;
anyone know why this is happening? running on windows 10 (if it matters)
is there any benefit/downside to using utc over local? does date_current_datetime() return different values?