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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.