aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-02-10 01:40:57 +0100
committerTristan Gingold <tgingold@free.fr>2014-02-10 01:40:57 +0100
commitf515f0956ee75d82f7bede20bc7da95cdeae85a9 (patch)
treee807539bb9ae44f087e67ce9df3244c384549c2d
parent1df58ba6e882f71a7c5d1a0ec6fcfba01cd02cb9 (diff)
downloadghdl-f515f0956ee75d82f7bede20bc7da95cdeae85a9.tar.gz
ghdl-f515f0956ee75d82f7bede20bc7da95cdeae85a9.tar.bz2
ghdl-f515f0956ee75d82f7bede20bc7da95cdeae85a9.zip
Use GMT for OS time stamp.
-rw-r--r--files_map.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/files_map.adb b/files_map.adb
index 5d8d5b0c0..bc0f4c8ea 100644
--- a/files_map.adb
+++ b/files_map.adb
@@ -25,6 +25,7 @@ with GNAT.Directory_Operations;
with Name_Table; use Name_Table;
with Str_Table;
with Ada.Calendar;
+with Ada.Calendar.Time_Zones;
package body Files_Map is
@@ -488,8 +489,11 @@ package body Files_Map is
function Get_Os_Time_Stamp return Time_Stamp_Id
is
use Ada.Calendar;
+ use Ada.Calendar.Time_Zones;
use Str_Table;
+ Now : constant Time := Clock;
+ Now_UTC : constant Time := Now - Duration (UTC_Time_Offset (Now) * 60);
Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
@@ -499,9 +503,8 @@ package body Files_Map is
M : Integer;
Res: Time_Stamp_Id;
begin
- -- FIXME: Clock is local time, while get_file_time_stamp returns
- -- GMT time.
- Split (Clock, Year, Month, Day, Sec);
+ -- Use UTC time (like file time stamp).
+ Split (Now_UTC, Year, Month, Day, Sec);
Res := Time_Stamp_Id (Start);
Append (Digit_To_Char (Year / 1000));