[libgnome-games-support: 10/13] Replace TimeVal with DateTime




commit c4ca62732b1d90c57d4afa21062a8a30535fadfd
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Tue Feb 8 20:40:16 2022 +0100

    Replace TimeVal with DateTime

 games/scores/history-file-importer.vala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/games/scores/history-file-importer.vala b/games/scores/history-file-importer.vala
index fe9af35..0cf6dba 100644
--- a/games/scores/history-file-importer.vala
+++ b/games/scores/history-file-importer.vala
@@ -49,11 +49,10 @@ public class HistoryFileImporter : Importer
 
     public static int64 parse_date (string date)
     {
-        TimeVal timeval = {};
-        var ret = timeval.from_iso8601 (date);
-        if (!ret)
+        var date_time = new DateTime.from_iso8601 (date, null);
+        if (date_time == null)
             warning ("Failed to parse date: %s", date);
-        return timeval.tv_sec;
+        return date_time.to_unix ();
     }
 
     /* Each game uses a somewhat different format for its scores; one game might


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]