static void getDate(Args _args) { System.DateTime _dateTime; Date _date; PurchTable _purchTable; ; _purchTable = PurchTable::find("12/01761"); _dateTime = System.DateTime::Parse(dateTime2str(_purchTable.createdDateTime)); _date = _dateTime.get_Date(); info(date2str(_date,-1,-1,-1,-1,-1,-1)); }
Note: if you get
“Request for the permission of type ‘InteropPermission’ failed.” error, you
need to use InteropPermission class:
static void getDate(Args _args) { System.DateTime _dateTime; Date _date; PurchTable _purchTable; InteropPermission intPerm = new InteropPermission(InteropKind::ClrInterop); ; _purchTable = PurchTable::find("12/01761"); intPerm.assert(); _dateTime = System.DateTime::Parse(dateTime2str(_purchTable.createdDateTime)); _date = _dateTime.get_Date(); CodeAccessPermission::revertAssert(); info(date2str(_date,-1,-1,-1,-1,-1,-1)); }
Thanks for comments.....