Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor fix for datetime tz conversion
  • Loading branch information
Martin-Molinero committed Mar 15, 2024
commit 95d48b3ecdd4d0801772702ccb9a50988b5cd59c
4 changes: 2 additions & 2 deletions src/runtime/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ private static NewReference TzInfo(DateTimeKind kind)
if (kind == DateTimeKind.Unspecified) return new NewReference(Runtime.PyNone);
var offset = kind == DateTimeKind.Local ? DateTimeOffset.Now.Offset : TimeSpan.Zero;
using var tzInfoArgs = Runtime.PyTuple_New(2);
Runtime.PyTuple_SetItem(tzInfoArgs.Borrow(), 0, Runtime.PyFloat_FromDouble(offset.Hours).Steal());
Runtime.PyTuple_SetItem(tzInfoArgs.Borrow(), 1, Runtime.PyFloat_FromDouble(offset.Minutes).Steal());
Runtime.PyTuple_SetItem(tzInfoArgs.Borrow(), 0, Runtime.PyLong_FromLongLong(offset.Hours).Steal());
Runtime.PyTuple_SetItem(tzInfoArgs.Borrow(), 1, Runtime.PyLong_FromLongLong(offset.Minutes).Steal());
var returnValue = Runtime.PyObject_CallObject(tzInfoCtor.Value, tzInfoArgs.Borrow());
return returnValue;
}
Expand Down