void OnStart()
{
//--- 現地時間、GMT、GMTとローカルコンピュータ時刻との差を秒単位で取得する
datetime time_local=TimeLocal();
datetime time_gmt =TimeGMT();
int offset =TimeGMTOffset();
//--- 取得した時間とオフセット値をログに表示する
PrintFormat("Local Time: %s, GMT Time: %s, Seconds Offset: %+d", (string)time_local, (string)time_gmt, offset);
/*
結果:
Local Time: 2024.04.18 19:35:52, GMT Time: 2024.04.18 12:35:52, Seconds Offset: -25200
*/
}
|