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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.