You need to sign in to do that
Don't have an account?

Datetime error
Datetime insdate;
insdate = 2013-10-07 00:00:00;
System.debug(insdate);
when i try to execute this as annonymous, I get the error unexpected token: '2013-10-07'
My question is, How do we assign a datetime value to a variable?
Hi John,
check the following links to answer for your questions.
http://boards.developerforce.com/t5/Other-Salesforce-Applications/How-to-Assign-a-DateTime-field-value-to-another-Datetime-field/td-p/97830
http://eprasu.wordpress.com/2010/01/25/salesforce-converting-datetime-to-format-yyyy-mm-ddthhmmssz/
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks,
Subhani,
Salesforce Certified Developer,
www.mydbsync.com
You could instantiate a date something like this: