public void FromNSDate() { //UTC now without the milliseconds var date = DateTime.UtcNow; date = date.AddMilliseconds(-date.Millisecond); IntPtr handle = ObjC.ToNSDate(date); var actual = ObjC.FromNSDate(handle); Assert.AreEqual(date.ToShortDateString(), actual.ToShortDateString()); Assert.AreEqual(date.ToShortTimeString(), actual.ToShortTimeString()); }
public IntPtr MarshalManagedToNative(object managedObj) { DateTime date = (DateTime)managedObj; return(ObjC.ToNSDate(date)); }
public IntPtr MarshalManagedToNative(object managedObj) { return(ObjC.ToNSDate((DateTime)managedObj)); }