[geary/wip/time_t-724335: 1/2] Fix invalid time_t conversion bug



commit c4780463b4ae415e15473059c4cf400d3c9ff3b7
Author: Charles Lindsay <chaz yorba org>
Date:   Fri Feb 14 15:24:48 2014 -0800

    Fix invalid time_t conversion bug
    
    This fixes all dates from showing up in the year 3800.

 src/engine/util/util-time.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/engine/util/util-time.vala b/src/engine/util/util-time.vala
index 0a52fb4..3c44cc8 100644
--- a/src/engine/util/util-time.vala
+++ b/src/engine/util/util-time.vala
@@ -21,7 +21,7 @@ public time_t datetime_to_time_t(DateTime datetime) {
     // month is 1-based in DateTime
     tm.month = Numeric.int_floor(datetime.get_month() - 1, 0);
     // Time's year is number of years after 1900
-    tm.year = Numeric.int_floor(datetime.get_year() - 1900, 1900);
+    tm.year = Numeric.int_floor(datetime.get_year() - 1900, 0);
     tm.isdst = datetime.is_daylight_savings() ? 1 : 0;
     
     return tm.mktime();


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