Example #1
0
    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());
    }
Example #2
0
        public IntPtr MarshalManagedToNative(object managedObj)
        {
            DateTime date = (DateTime)managedObj;

            return(ObjC.ToNSDate(date));
        }
Example #3
0
 public IntPtr MarshalManagedToNative(object managedObj)
 {
     return(ObjC.ToNSDate((DateTime)managedObj));
 }