2004-08-31 Mike Kestner <mkestner@ximian.com>
* glib/Marshaller.cs : fix utc offseting for time_tToDateTime. [Fixes #60960] svn path=/trunk/gtk-sharp/; revision=33107
This commit is contained in:
parent
b6bd5a901a
commit
da322c565f
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-08-31 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* glib/Marshaller.cs : fix utc offseting for time_tToDateTime.
|
||||
[Fixes #60960]
|
||||
|
||||
2004-08-30 Tambet Ingo <tambet@ximian.com>
|
||||
|
||||
* glib/ListBase.cs : indexing bugfix for CopyTo.
|
||||
|
|
|
@ -161,6 +161,7 @@ namespace GLib {
|
|||
}
|
||||
|
||||
static DateTime local_epoch = new DateTime (1970, 1, 1, 0, 0, 0);
|
||||
static int utc_offset = (int) (DateTime.Now.Subtract (DateTime.UtcNow).TotalSeconds);
|
||||
|
||||
public static IntPtr DateTimeTotime_t (DateTime time)
|
||||
{
|
||||
|
@ -169,7 +170,8 @@ namespace GLib {
|
|||
|
||||
public static DateTime time_tToDateTime (IntPtr time_t)
|
||||
{
|
||||
return local_epoch.AddSeconds ((int)time_t);
|
||||
Console.WriteLine ("in time_tToDateTime from");
|
||||
return local_epoch.AddSeconds ((int)time_t + utc_offset);
|
||||
}
|
||||
|
||||
[DllImport("glibsharpglue")]
|
||||
|
|
Loading…
Add table
Reference in a new issue