|
@@ -27,6 +27,7 @@
|
|
|
#include <AK/MemoryStream.h>
|
|
|
#include <AK/URL.h>
|
|
|
#include <LibCore/AnonymousBuffer.h>
|
|
|
+#include <LibCore/DateTime.h>
|
|
|
#include <LibIPC/Decoder.h>
|
|
|
#include <LibIPC/Dictionary.h>
|
|
|
#include <LibIPC/File.h>
|
|
@@ -205,4 +206,14 @@ bool decode(Decoder& decoder, Core::AnonymousBuffer& buffer)
|
|
|
return buffer.is_valid();
|
|
|
}
|
|
|
|
|
|
+bool decode(Decoder& decoder, Core::DateTime& datetime)
|
|
|
+{
|
|
|
+ i64 timestamp = -1;
|
|
|
+ if (!decoder.decode(timestamp))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ datetime = Core::DateTime::from_timestamp(static_cast<time_t>(timestamp));
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
}
|