Time and Date

From alt:V Wiki
Jump to navigation Jump to search

The Time and Date influences various parts of the game. Here you can learn more about the system.

Time

GTA V

The time is influencing the day-night cycle. The time goes from 00h 00m 00s to 23h 59m 59s. The default speed of time is: Two seconds are one GTA V minute (1.000ms[Real]->30.000ms[GTA V]).

alt:V

By default the ingame time isn't synced across the clients. It has to be synced manually for example: Setting the time and date on connect and then setting the conversation rate with setMsPerGameMinute.

Useful setter:

  • setDateTime - Sets the date and time for a player on server. (Serverside)
  • setMsPerGameMinute - Sets the conversation rate of real time to GTA V time. (Clientside)
  • setClockTime - Set GTA V time to a specific time. (Native)
  • addToClockTime - Adds hours, minutes and seconds to the GTA V time. (Native)
  • advanceClockTimeTo - Forwards GTA V time to specific GTA V time. (Native)
  • pauseClock - Pauses the GTA V time. (Native)

Useful getter:

  • getMsPerGameMinute - Gets the conversation rate of real time to GTA V time. Default: 2.000ms[Real]->1m[GTA V] (Clientside)
  • getClockHours - Gets the Hour of the GTA V time. (Native)
  • getClockMinutes - Gets the Minute of the GTA V time. (Native)
  • getClockSeconds - Gets the Secods of the GTA V time. (Native)
  • getPosixTime - Gets the system time & date in posix format. (Native)
  • getUtcTime - Gets the system time & date in utc format. (Native)
  • getLocalTime - Gets the system time & date in local format. (Native)

Date

GTA V

The Date is influencing the Clouds and the Moon, it has different moon phases and it seems that the moon also has libration. The Stars aren't affected by the date. The Months and days are starting with zero, this means every day and month needs to be calculated with -1 (Month [0-11], Days [0-30]). The Week starts with Sunday. Note: When setting an invalid date eg 31.12.2020 you may experience Problems.

alt:V

By default the ingame date isn't synced across the clients. It has to be synced manually for example: Setting the time and date on connect and then setting the conversation rate with setMsPerGameMinute.

Useful setter:

  • setDateTime - Sets the date and time for a player on server. (Serverside)
  • setMsPerGameMinute - Sets the conversation rate of real time to GTA V time. (Clientside)
  • setClockDate - Set GTA V date to a specific date. (Native)
  • pauseClock - Pauses the GTA V time. (Native)

Useful getter:

  • getClockDayOfWeek - Gets the Day of the GTA V Date (0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday). (Native)
  • getClockDayOfMonth - Gets the Day of the Month from the GTA V Date. (Native)
  • getClockMonth - Gets the Month of the GTA V Date (0-11). (Native)
  • getClockYear - Gets the Year of the GTA V Date. (Native)
  • getPosixTime - Gets the system time & date in posix format. (Native)
  • getUtcTime - Gets the system time & date in utc format. (Native)
  • getLocalTime - Gets the system time & date in local format. (Native)