-
-
Notifications
You must be signed in to change notification settings - Fork 5
Date Time API
Nenkai edited this page Jul 14, 2024
·
3 revisions
Warning
This API was introduced after GT4.
var time = pdistd::MTime::getCurrentTime();
var year = time.year;
var month = time.month;
var day = time.day;
var hour = time.hour;
var minute = time.minute;
var second = time.second;
var datetime = pdistd::MTime();
// Setting by amount of seconds
datetime.setBySecond(60);
// Setting by amount of minutes
datetime.setBySecond(1);
// Creating using specified utc string
var datetime2 = pdistd::MTime("2024/01/01 12:00:00");
var us = pdistd::GetSystemTimeMicroSecond();
var serverTime = pdiext::getBetterTime();
var time_str = pdiext::GetDateTimeString(sec); // 29/12/2022 03:28'44
var time_str_short = pdiext::GetDateTimeStringShort(sec); // 29/12/2022 03:29
var race_time_str = pdiext::GetRaceTimeString(ms); // 0:00.001
var diff_str = pdiext::GetDiffTimeString(sec); // +00.200, +00.000, -00.200,'
var unk = pdiext::GetDiffTimeString(pdiext::MAX_LAPTIME1000);