3

Im sending from Javascript Remoting datetime in this format : "2017-04-04T00:00:00". Whats the safest and best method to parse this kind of date format in Apex to Date?

1 Answer 1

2

There's so many different routes you could take this, safest and best method is debatable when it comes to parsing dates, but you could do something as easy as

Date dt = Date.valueOf('2017-04-04T00:00:00'); //2017-04-04 00:00:00
System.debug('dt' + dt);

Check out Date Class.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .