diff foosdk/sdk/pfc/filetimetools.h @ 1:20d02a178406 default tip

*: check in everything else yay
author Paper <paper@tflc.us>
date Mon, 05 Jan 2026 02:15:46 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/foosdk/sdk/pfc/filetimetools.h	Mon Jan 05 02:15:46 2026 -0500
@@ -0,0 +1,20 @@
+#pragma once
+
+namespace pfc {
+	typedef uint64_t t_filetimestamp;
+	static constexpr t_filetimestamp filetimestamp_invalid = 0;
+	static constexpr t_filetimestamp filetimestamp_1second_increment = 10000000;
+
+	t_filetimestamp filetimestamp_from_string(const char * date);
+	t_filetimestamp filetimestamp_from_string_utc(const char* date);
+	// From ISO 8601 time
+	t_filetimestamp filetimestamp_from_string_ISO_8601(const char* date);
+
+	//! Warning: this formats according to system timezone settings, created strings should be used for display only, never for storage.
+	pfc::string_formatter format_filetimestamp(t_filetimestamp p_timestamp);
+	//! UTC timestamp
+	pfc::string_formatter format_filetimestamp_utc(t_filetimestamp p_timestamp);
+	//! Local timestamp with milliseconds
+	pfc::string_formatter format_filetimestamp_ms(t_filetimestamp p_timestamp);
+
+}