enDatetime handles dates and times.
| Name | Returns | Parameters | Description |
|---|---|---|---|
| enDatetime_AddMillisec(...) | integer | integer millisec integer add |
Safely adds add to millisec using the 31-day range of -2147483648 to 617316351 produced by enDatetime_*ToMillisec(...) functions. |
| enDatetime_DaypartToHMS(...) | list | float daypart | Converts a daypart (0.0-1.0 range generated by enDatetime_EnvironmentToDaypart(...)) into an [h, m, s] list. |
| enDatetime_DaysInMonth(...) | integer | integer year integer month |
Gets the number of days (28-31) in the specified month (1-12) and year. |
| enDatetime_DaysInYear(...) | integer | integer year | Gets the number of days (365 or 366) in a specified year. |
| enDatetime_DaysInYM(...) | integer | list YM | Gets the number of days (28-31) using a [Y, M, ...] list. |
| enDatetime_EnvironmentToDaypart(...) | float | vector position | Gets the part of the day (0.0-1.0) that has passed in the full midnight-to-midnight day cycle of the environment at a given region-scope position. |
| enDatetime_EnvironmentToDaypartHere() | float | n/a | Gets the part of the day (0.0-1.0) that has passed in the full midnight-to-midnight day cycle of the environment at the script's current position. |
| enDatetime_EnvironmentToHMS(...) | list | vector position | Gets the time of day as [h, m, s] in the day cycle of the environment at a given region-scope position. |
| enDatetime_EnvironmentToHMS_Here() | list | vector position | Gets the time of day as [h, m, s] in the day cycle of the environment at the script's current position. |
| enDatetime_HMToPretty(...) | string | list hm integer flags |
Converts a list starting with [h, m, ...] into a prettified string like "8:00 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_HMSToPretty(...) | string | list hms integer flags |
Converts a list starting with [h, m, s, ...] into a prettified string like "8:00:00 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_HMSUToPretty(...) | string | list hms integer flags |
Converts a [h, m, s, u] list into a prettified string like "8:00:00.12345 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_MToPretty(...) | string | integer month | Converts a month (1-12) into an English textual representation of the month ("January" to "December"). |
| enDatetime_MToPrettyShort(...) | string | integer month | Converts a month (1-12) into an abbreviated English textual representation of the year ("Jan" to "Dec"). |
| enDatetime_NowToTimestamp() | string | n/a | Alias for llGetTimestamp(). |
| enDatetime_NowToUnix() | integer | n/a | Alias for llGetUnixTime(). |
| enDatetime_NowToYMDHMS() | list | n/a | Gets the current date and time as a [Y, M, D, h, m, s] list. |
| enDatetime_NowToYMDHMSU() | list | n/a | Gets the current date and time as a [Y, M, D, h, m, s, u] list. Adds subsecond (microsecond) precision, but costs more memory. |
| enDatetime_TimestampToMillisec(...) | integer | string timestamp | Converts any timestamp generated by llGetTimestamp into an integer representation of milliseconds within a monthly 31-day range of -2147483648 to 617316351. |
| enDatetime_TimestampToYMDHMSU(...) | list | string timestamp | Converts any timestamp generated by llGetTimestamp into a list of integers, [Y, M, D, h, m, s, u], where s is the number of whole seconds and u is the number of microseconds. |
| enDatetime_TimestampDiffToSeconds(...) | integer | string timestamp_a string timestamp_b |
Gets the number of seconds between two timestamps. Both timestamps must be Unix-safe. Imprecise by up to 1 second. |
| enDatetime_TimestampDiffToSecondsPrecise(...) | float | string timestamp_a string timestamp_b |
Gets the number of seconds with subsecond precision between two timestamps. |
| enDatetime_TimestampToPretty(...) | string | string timestamp integer flags |
Converts a timestamp into a prettified string like "January 1, 2026 8:00:00 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_TimestampToUnix(...) | integer | string timestamp | Converts a timestamp into its equivalent Unix time. |
| enDatetime_UnixToDOW(...) | string | integer unixtime | Converts any Unix time into the day of the week at that time. |
| enDatetime_UnixToIOW(...) | integer | integer unixtime | Converts any Unix time into the index of the day of the week at that time, starting with 0 for Monday. |
| enDatetime_UnixToPretty(...) | string | integer unixtime integer flags |
Converts a Unix time into a prettified string like "January 1, 2026 8:00:00 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_UnixToTimestamp(...) | string | integer unixtime | Converts Unix time into a llGetTimestamp-style ISO 8601 timestamp. |
| enDatetime_UnixToYMDHMS(...) | list | integer unixtime | Converts any Unix time into a list of integers, [Y, M, D, h, m, s]. |
| enDatetime_YMDHMSDiffToSeconds(...) | integer | list YMDhms_a list YMDhms_b |
Returns the number of seconds between two lists (a - b; if positive, a is later). Requires that both times be valid as Unix times to save memory. |
| enDatetime_YMDHMSToPretty(...) | string | list YMDhms integer flags |
Converts a [Y, M, D, h, m, s, ...] list into a prettified string like "January 1, 2026 8:00:00 AM" using FLAG_ENDATETIME_* flags. |
| enDatetime_YMDHMSToUnix(...) | integer | list YMDhms | Converts a [Y, M, D, h, m, s, ...] list into its equivalent Unix time. |
| enDatetime_YMDHMSUToMillisec(...) | integer | string timestamp | Converts a [Y, M, D, h, m, s, u] list into an integer representation of milliseconds within a monthly 31-day range of -2147483648 to 617316351. |
| enDatetime_YMDHMSUToTimestamp(...) | integer | string timestamp | Converts a [Y, M, D, h, m, s, u] list into a llGetTimestamp-style ISO 8601 timestamp. |
| enDatetime_YMDToPretty(...) | string | list YMDhms integer flags |
Converts a [Y, M, D, ...] list into a prettified string like "January 1, 2026" using FLAG_ENDATETIME_* flags. |
| Name | Required Value | Description |
|---|---|---|
| TRACE_ENDATETIME | n/a | Enables trace logging (not used). |
enDatetime calls no callback functions.
| Name | Description |
|---|---|
| FLAG_ENDATETIME_12_HOUR | When generating a pretty time, use 12-hour time ("4:00P") instead of 24-hour time ("16:00"). |
| FLAG_ENDATETIME_12_HOUR_M | When generating a 12-hour time, add an "M" ("4:00PM"). |
| FLAG_ENDATETIME_12_HOUR_SPACE | When generating a 12-hour time, add a space ("4:00 PM"). |
| FLAG_ENDATETIME_TEXT_DMY | When generating a pretty date, order it as Day Month Year ("1 January 2026"). |
| FLAG_ENDATETIME_TEXT_MDY | When generating a pretty date, order it as Month Day Year ("January 1, 2026"). |
| FLAG_ENDATETIME_TEXT_MONTH_SHORT | When generating a pretty date, use a short month ("Jan 1, 2026"). |
| FLAG_ENDATETIME_TEXT_MONTH_SHORT_DOT | When generating a pretty date with a short month, add a period ("Jan. 1, 2026"). |
| FLAG_ENDATETIME_TEXT_DAY_ORDINAL | When generating a pretty date as Day Month Year, add an ordinal ("1st January 2026"). |
| FLAG_ENDATETIME_TEXT_DAY_OF | When generating a pretty date as Day Month Year with an ordinal, add "of" ("1st of January 2026"). |
| FLAG_ENDATETIME_PAD_ZEROES_HOURS | When generating a pretty time, pad hours with zeroes ("08:0:0"). |
| FLAG_ENDATETIME_PAD_ZEROES_MINUTES | When generating a pretty time, pad minutes with zeroes ("8:00:0"). |
| FLAG_ENDATETIME_PAD_ZEROES_SECONDS | When generating a pretty time, pad seconds with zeroes ("8:0:00"). |