however, the string format needs to be yyyy-mm-dd hh:mm:ss so you will need to prbably convert your string to above format and then use datetime.valueOf() method.
You can use String str = Datetime.now().format(); to get your local datetime format, and covert your string to this format, then use Datetime dt = Datetime.parse(str); to turn the String to Datetime.
you can use the datetime.valueOf(string)
however, the string format needs to be yyyy-mm-dd hh:mm:ss
so you will need to prbably convert your string to above format and then use datetime.valueOf() method.
String str = Datetime.now().format();
to get your local datetime format,
and covert your string to this format,
then use
Datetime dt = Datetime.parse(str);
to turn the String to Datetime.
Hi
check below links
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm