[libgames-support] Have HistoryFileImporter.parse_date return an int64
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgames-support] Have HistoryFileImporter.parse_date return an int64
- Date: Sun, 14 Feb 2016 22:01:11 +0000 (UTC)
commit bdd2da22502d54424498504d7d215366b1ba91e7
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Feb 14 15:57:51 2016 -0600
Have HistoryFileImporter.parse_date return an int64
games/scores/history-file-importer.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/games/scores/history-file-importer.vala b/games/scores/history-file-importer.vala
index 5094fa6..0bc35e3 100644
--- a/games/scores/history-file-importer.vala
+++ b/games/scores/history-file-importer.vala
@@ -47,10 +47,10 @@ public class HistoryFileImporter : Importer
*
* FIXME: GPLv2+, can't release with this.
*/
- public static DateTime? parse_date (string date)
+ public static int64 parse_date (string date)
{
if (date.length < 19 || date[4] != '-' || date[7] != '-' || date[10] != 'T' || date[13] != ':' ||
date[16] != ':')
- return null;
+ return 0;
var year = int.parse (date.substring (0, 4));
var month = int.parse (date.substring (5, 2));
@@ -60,7 +60,7 @@ public class HistoryFileImporter : Importer
var seconds = int.parse (date.substring (17, 2));
var timezone = date.substring (19);
- return new DateTime (new TimeZone (timezone), year, month, day, hour, minute, seconds);
+ return new DateTime (new TimeZone (timezone), year, month, day, hour, minute, seconds).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]