Dear Folks,
Here is the code to convert DateTime to Date Type.
Here is the code to convert DateTime to Date Type.
DateTime Dt = System.today(); Date D = Date.newInstance(Dt.year(),Dt.Month(),Dt.day());
many thanks dude!
ReplyDeleteActually there is an easier way to convert it to date now. Not sure if the below method existed when u created the above Post.
ReplyDeleteDateTime Dt = Datetime.newinstance(2008, 2, 5, 8, 30, 12);
Date D = Dt.date();
Try it out!