TimeUtils

TimeUtils

Pure C# time utilities to replace Godot’s Time class. Provides AOT-compatible time operations for iOS/Android.

Project: GridPlacement v6.0
Layer: Godot
Source: Godot/Core/Time/TimeUtils.cs
Namespace: GridBuilding.Core.Time
Kind: class

Parsing Method: AST-based (Roslyn) - NOT regex

⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.

Methods

GetUnixTime

Gets the current Unix timestamp in seconds. Equivalent to Godot’s Time.GetUnixTimeFromSystem().

Returns: double

GetUnixTimeMilliseconds

Gets the current Unix timestamp in milliseconds.

Returns: long

GetUnixTimePrecise

Gets the current Unix timestamp with fractional seconds. More precise than GetUnixTime().

Returns: double

GetDateTimeString

Gets the current time as a formatted string.

Returns: string

Parameters:

  • string format

GetDateTimeStringUtc

Gets the current UTC time as a formatted string.

Returns: string

Parameters:

  • string format

FromUnixTime

Converts Unix timestamp to DateTime.

Returns: DateTime

Parameters:

  • double unixTime

FromUnixTimeMilliseconds

Converts Unix timestamp in milliseconds to DateTime.

Returns: DateTime

Parameters:

  • long unixTimeMs

GetElapsedSeconds

Gets elapsed time in seconds between two Unix timestamps.

Returns: double

Parameters:

  • double startTime
  • double endTime

GetElapsedSecondsSince

Gets elapsed time in seconds since a Unix timestamp.

Returns: double

Parameters:

  • double startTime

HasDurationPassed

Checks if a duration has passed since a given timestamp.

Returns: bool

Parameters:

  • double startTime
  • double durationSeconds