Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

Time Class

Simplifies the management of date/time information.

The Time class is available for programs that require time and date management in a multi-platform manner.

To get the current system time, use the Query() action.

Structure

The Time class consists of the following fields:

Access
NameTypeComment
 DayINTDay (1 - 31)
 DayOfWeekINTDay of week (0 - 6) starting from Sunday.
 HourINTHour (0 - 23)
 MicroSecondINTA microsecond is one millionth of a second (0 - 999999)
 MilliSecondINTA millisecond is one thousandth of a second (0 - 999)
 MinuteINTMinute (0 - 59)
 MonthINTMonth (1 - 12)
 SecondINTSecond (0 - 59)
 SystemTimeINT64Represents the system time when the time object was last queried.

The SystemTime field returns the system time if the Time object has been queried. The time is represented in microseconds. This field serves no purpose beyond its initial query value.

 TimestampINT64Read this field to get representation of the time as a single integer.

The Timestamp field is a 64-bit integer that represents the time object as an approximation of the number of milliseconds represented in the time object (approximately the total amount of time passed since Zero-AD). This is convenient for summarising a time value for comparison with other time stamps, or for storing time in a 64-bit space.

The Timestamp value is dynamically calculated when reading this field.

 YearINTYear (-ve for BC, +ve for AD).

Actions

The following actions are currently supported:

QueryUpdates the values in a time object with the current system date and time.
RefreshRefreshes the state of an object.

Methods

The following methods are currently supported:

GetTimeZoneInfoReturns time-zone metadata and transition records.
ERR pt::GetTimeZoneInfo(OBJECTPTR Object, STRVIEW ZoneID, INT StartYear, INT EndYear, struct TimeZoneInfo ** Info)
ParameterDescription
ZoneIDZone identifier, or an empty string to request the local system zone.
StartYearInclusive first year. Must be in the supported 1601-9999 range.
EndYearInclusive final year. Must be >= StartYear, no later than 9999 and within 400 years of StartYear.
InfoReceives the allocated metadata and transition resource. Release with FreeResource() when no longer required.

Returns normalised time-zone information for a named zone or for the host system's local zone. The returned TimeZoneInfo resource includes the preferred public zone identifier, the host-native identifier, the data source, standard UTC offset and any transition records found within the requested inclusive year range.

The ZoneID value may be empty to request the local system zone. Explicit zone IDs support UTC aliases on all platforms. Linux builds also accept IANA zone names that resolve under /usr/share/zoneinfo. Windows builds accept Windows native time-zone IDs and the IANA IDs that are mapped by the Core Windows time-zone wrapper.

For explicit zone requests, an unknown or unsupported ID returns ERR::Search. For local-zone requests, host lookup failure is not fatal; the method returns a UTC result with Source set to utc and IsFallback set to 1.

Transition Instant values are UTC Unix epoch timestamps in microseconds. OffsetBefore, OffsetAfter and BaseOffset are expressed in seconds east of UTC. DaylightSaving is 1 when the transition enters a daylight-saving period.

Error Codes
OkayTime-zone information was returned. Local-zone failures may return a UTC fallback result.
SearchAn explicit zone ID could not be resolved.
OutOfRangeA value is outside of the valid range
AllocMemoryFailed to create a new memory block
SystemCallA required host time-zone API call failed.
NullArgsFunction call missing argument value(s)
SetTimeApply the time to the system clock.
ERR pt::SetTime(OBJECTPTR Object)

This method will apply the time object's values to the BIOS. Depending on the host platform, this method may only work if the user is logged in as the administrator.

Time class documentation © Paul Manias © 1996-2026

TimeZoneInfo Structure

Time zone information returned from GetTimeZoneInfo()

FieldTypeDescription
ZoneIDSTRINGPreferred public ID, e.g. Europe/London or UTC.
NativeIDSTRINGHost-native ID, e.g. GMT Standard Time on Windows.
SourceSTRING"tzif", "win32", or "utc".
DataPathSTRINGTZif path on Linux, otherwise empty.
VersionSTRINGTZDB/source version if available, otherwise empty.
Transitionskt::vector<TimeZoneTransition>Transitions available for the requested range.
BaseOffsetINTStandard UTC offset in seconds.
StartYearINT16Inclusive requested start year.
EndYearINT16Inclusive requested end year.
IsLocalINT81 if ZoneID requested the local system zone.
IsFallbackINT81 if UTC fallback was used.
Time class documentation © Paul Manias © 1996-2026