Синглтон Time (https://docs.godotengine.org/en/stable/classes/class_time.html) предоставляет get_datetime_dict_from_system (https://docs.godotengine.org/en/stable/classes/class_time.html#class-time-method-get-datetime-dict-from-system), возвращающий словарь с информацией о времени, полученной из системных часов.
# Read a dictionary of clock fields
var clock_fields = Time.get_time_dict_from_system()
print(clock_fields) # {day:X, dst:False, hour:xx, minute:xx, month:xx, second:xx, weekday:x, year:xxxx}
Для вашего формата HH:MM более простая функция get_time_dict_from_system (https://get_time_dict_from_system) даёт только поля часов, минут и секунд
var clock_fields = Time.get_time_dict_from_system()
# Format each field with 2 zero-padded digits, e.g. 02:31:24
print("%02d:%02d:%02d" % [clock_fields.hour, clock_fields.minute, clock_fields.second])
В ранних версиях Godot (-3.4) можно также вызвать OS.get_time() (https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-get-time), хотя в 3.5+ он устарел, а в 4.x удалён:
Переведено с английского·Показать оригиналThe Time (https://docs.godotengine.org/en/stable/classes/class_time.html) singleton provides get_datetime_dict_from_system (https://docs.godotengine.org/en/stable/classes/class_time.html#class-time-method-get-datetime-dict-from-system), which gives you a dictionary containing time information obtained from the system clock.
# Read a dictionary of clock fields
var clock_fields = Time.get_time_dict_from_system()
print(clock_fields) # {day:X, dst:False, hour:xx, minute:xx, month:xx, second:xx, weekday:x, year:xxxx}
For your HH:MM formatting, the simpler get_time_dict_from_system (https://get_time_dict_from_system) gives just the hour, minute and second fields
var clock_fields = Time.get_time_dict_from_system()
# Format each field with 2 zero-padded digits, e.g. 02:31:24
print("%02d:%02d:%02d" % [clock_fields.hour, clock_fields.minute, clock_fields.second])
On earlier Godot releases (-3.4), you can also call OS.get_time() (https://docs.godotengine.org/en/stable/classes/class_os.html#class-os-method-get-time), though it is deprecated in 3.5+ and gone in 4.x: