function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
if any possible to convert date-time to date field?
Example:
Date/Time
Tue Jul 10 00:00:00 GMT 2012
Expected Output:(Date output)
Tue Jul 10, 2012
Hello westjohn,
Your output is not a valid date format, But you could be able to get that format in string with help of following code.
Datetime dt = DateTime.newInstance(Date.today(), Time.newInstance(0, 0, 0, 0)); String formattedDate=dt.format('EEE MMM dd hh:mm:ss')+' GMT '+ dt.format('yyyy'); System.debug('formattedDate : ' + formattedDate);
Hi,
You can use date(),a instance method of DateTime class.
thanks Alok_vibrant..
But i didn't get the exact answer.. i only get the following answer
2012-07-10 00:00:00
But i want the exact answer(Tue Jul 10, 2012)
My code
dateTime dd = Acc.LastActivityDate;Date dd1 = dd.Date();
How to get the exact format from date() function?
Thanks Rahul..
Hello westjohn,
Your output is not a valid date format, But you could be able to get that format in string with help of following code.
All Answers
Hi,
You can use date(),a instance method of DateTime class.
thanks Alok_vibrant..
But i didn't get the exact answer.. i only get the following answer
2012-07-10 00:00:00
But i want the exact answer(Tue Jul 10, 2012)
My code
dateTime dd = Acc.LastActivityDate;
Date dd1 = dd.Date();
How to get the exact format from date() function?
Hello westjohn,
Your output is not a valid date format, But you could be able to get that format in string with help of following code.
Thanks Rahul..