openOMSI GitHub Discord

Docs / Making content / HTML textures

Time, date, locale

1 min readEdit this pagedocs/HTMLTEXTURE.md

omsi.time.hour, .minute, .second Simulation clock, as numbers
omsi.time.asString HH:MM:SS
omsi.timestamp Now as a timestamp: seconds since 1970-01-01 on the simulation's calendar, no time zone
omsi.date.day, .month, .year Simulation date, as numbers
omsi.date.asString DD.MM.YYYY, or MM/DD/YYYY when locale is en
omsi.locale Interface language as an ISO 639-1 code (en, de ...)
omsi.weather The weather, null until it is known: temperature (°C), humidity (relative, 0..1), visibility (m, the weather's fog range), clouds (the weather's cloud type, -1 clear), precip (0 none, 1 rain, 2 snow), precipRate (0..1)

These are set before omsi.update runs and change with the simulation clock, once per second. Use omsi.locale to pick your texts, and fall back to English for languages you didn't write.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open