void main () { int64 unix_timestamp = 1299262391; // Convert Unix timestamp to GLib.DateTime GLib.DateTime date = GLib.DateTime.new_from_unix_local(unix_timestamp); // Format the date to a readable string string formatted_date = date.format("%Y-%m-%d %H:%M:%S"); print("Converted Date: %s\n", formatted_date); }
GLib.DateTime.new_from_unix_local(unix_timestamp)
1299262391
GLib.DateTime
format()
DateTime
date.format("%Y-%m-%d %H:%M:%S")
2011-03-04 18:13:11
print
GLib.DateTime.new_from_unix_local()
GLib.DateTime.new_from_unix_local(1514764800)
GLib.DateTime.to_unix()
date.to_unix()
GLib.DateTime.new_local()
GLib.DateTime.new_local(2018, 7, 15, 12, 30, 45)
GLib.DateTime.format()
GLib.DateTime.now_local()