[Gtk-sharp-list] [PATCH] small change in the glib DateTime to time_t marshaller

Chris Rivera crivera at novell.com
Wed Aug 17 15:23:26 EDT 2005


Howdy folks,

The DateTime to time_t marshaller creates a DateTime instance set to
midnight of January 1, 1970 and subtracts that from the DateTime
instance passed into the marshaller to obtain the time_t.  The DateTime
instance passed to DateTimeTotime_t() should be in the caller's local
time zone.  However, the epoch DateTime instance is not.  DateTime (int,
int, int, int, int, int) does not take into account the local time zone.
Thus, the resulting time_t is off by the UTC offset of the caller.

I thought that maybe you were required to convert the DateTime instance
to UTC before passing it to the marshaller until I saw that the epoch
instance in the marshaller was named local_epoch.

This patch ensures that both the DateTime instance passed into the
marshaller and the epoch instance are in UTC before doing the
subtraction.

Please CC me on any responses as I am not subscribed to the list.

Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GLib-fix-DateTime-marshaller.patch
Type: text/x-patch
Size: 987 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20050817/8273c71e/GLib-fix-DateTime-marshaller.bin


More information about the Gtk-sharp-list mailing list