always check range before casting time_t to mrb_int