The problem arises, if we export to latex. As it is now, the timestamps are written respecting the local timezone. Importing this back with tex2lyx, everything is OK, if one happens to be in same timezone. But for different timezones this changes.
This patch uses GMT for read/write tex.
Korneldiff --git a/src/Changes.cpp b/src/Changes.cpp
index 766b698..29095f9 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -400,7 +400,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
}
docstring chgTime;
- chgTime += ctime(&change.changetime);
+ chgTime += asctime(gmtime(&change.changetime));
// remove trailing '\n'
chgTime.erase(chgTime.end() - 1);
diff --git a/src/support/lyxtime.cpp b/src/support/lyxtime.cpp
index 9bdde9c..2a74b36 100644
--- a/src/support/lyxtime.cpp
+++ b/src/support/lyxtime.cpp
@@ -57,6 +57,7 @@ time_t from_ctime(string t)
<< "ยด (invalid format)");
return static_cast<time_t>(-1);
}
+ loc_dt.setTimeSpec(Qt::UTC);
return loc_dt.toTime_t();
}
diff --git a/src/tex2lyx/test/test-structure.tex b/src/tex2lyx/test/test-structure.tex
index 096da41..745872b 100644
--- a/src/tex2lyx/test/test-structure.tex
+++ b/src/tex2lyx/test/test-structure.tex
@@ -107,9 +107,9 @@ An environment
\end{quote}
We also support change tracking:
-\lyxadded{Hans Wurst}{Sun Nov 6 10:39:39 2011}{Added text}
+\lyxadded{Hans Wurst}{Sun Nov 6 09:39:39 2011}{Added text}
some parts remain
-\lyxdeleted{Hans Wurst}{Sun Nov 6 10:39:55 2011}{This was the original text}
+\lyxdeleted{Hans Wurst}{Sun Nov 6 09:39:55 2011}{This was the original text}
some parts remain
\section*{A starred section for floats}
signature.asc
Description: This is a digitally signed message part.
