You need to sign in to do that
Don't have an account?
Hseth
How to use Parse method for Datetimeq
Hi ,
I am using the code given beow nad it gives me an exception : "System.TypeException: Invalid date/time: 11/11/2010"
THe code I am using is
datetime mydatetime;
mydatetime = datetime.parse('11/11/2010');
Cna someone please suggest the solution.
Regards
Himanshoo
According to the documentation the datetime parse method:
Constructs a Datetime from the String datetime in
the local time zone and format.
It would require a properly formatted datetime string.
You might be better off using the newinstance method, if you know the format of your inbound string.
Something like this:
In my opinion, there is no parse method in the datetime method.
Go through the documentation available on
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_select_dateformats.htm
Hope this helps.