Am Sonntag, 6. Januar 2013 um 20:04:00, schrieb Kornel Benko <kor...@lyx.org>
> Am Freitag, 4. Januar 2013 um 19:36:38, schrieb Georg Baum 
> <georg.b...@post.rwth-aachen.de>
> > Jean-Marc Lasgouttes wrote:
> > 
> > > Isn't this a bug in LyX? I'd think LyX should use UTC or something like
> > > that for the times we use. Then we could translate that to the user's
> > > timezone for UI purposes.
> > 
> > Exactly. .lyx files should not depend on the time zone used for editing.
> > 
> 
> They do not depend on time zone. Only exported tex is dependent.
> 
> It is the source .tex file with
> the entry
>       \lyxadded{Hans Wurst}{Sun Nov  6 10:39:39 2011}{Added text}
> 
> and converting this with tex2lyx yields to the difference.
> 
> To interpret the Change::changetime as ascii, we use ctime(),
> but maybe it would be better using
>       asctime(gmtime())
> instead.
> 
> > Georg

How about this one:
Exporting to latex gives now
        Sun Nov  6 10:39:55 CET 2011
isead of 
        Sun Nov  6 10:39:55 2011
as date in track-changes.

        Kornel 
diff --git a/src/Changes.cpp b/src/Changes.cpp
index 766b698..5c2cc8d 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -384,6 +384,14 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author,
 } //namespace anon
 
 
+static docstring clyxtime(time_t ct)
+{
+	tm *t = localtime(&ct);
+	static char str[300];
+	strftime(str, sizeof(str)-1, "%a %b %e %T %Z %Y", t);
+	return(from_ascii(str));
+}
+
 int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 			     Change const & oldChange, Change const & change,
 			     OutputParams const & runparams)
@@ -398,11 +406,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 		os << '}';
 		column++;
 	}
-
-	docstring chgTime;
-	chgTime += ctime(&change.changetime);
-	// remove trailing '\n'
-	chgTime.erase(chgTime.end() - 1);
+	docstring chgTime = clyxtime(change.changetime);
 
 	docstring macro_beg;
 	if (change.type == Change::DELETED)

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to