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

Query Result Dateformat
How do you format the output of a date field in Visualforce? I want to evalute the date in a series of if else statements, but I am recieving a long number such as 1299542400000 when the querry runs. How can I format the output to be usefull?? Thanks in advance.
List<Opportunity> Opptys2 = [SELECT LastActivityDate, Activity_Status__c FROM Opportunity ORDER BY LastActivityDate DESC];
List<OpportunityFeed> Opptys = [SELECT id, (SELECT CreatedDate FROM FeedComments ORDER BY CreatedDate DESC) FROM OpportunityFeed];
Chris
Yes, that 0 was just to give you an example and fetch the first element of the list.
to iterate the complete record set, you can use a for loop:
All Answers
I tried this query and it gives : "2009-09-10 16:44:11".
Try assigning the result in a Datetime type variable.
I tried that and It says Illegal assignment from Schema.SObjectField to Datetime.
This is not correct. It should be:
For learning purposes, is the 0 the record number in the list? If i am using a loop, what would be the best way to go to the next record each time?
Yes, that 0 was just to give you an example and fetch the first element of the list.
to iterate the complete record set, you can use a for loop:
That makes sense, thank you so much!