• KCW
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I know that this is a question thats gone around a lot but I still dont have a good solution to the problem

 

I understand that date times are stores in the salesforce database as UTC, but on standard oppertunity pages the time will correctly display as the local time, but when i display the time on the visual force page it jsut shows as UTC again!!!

 

I know about the apex .format() as a way to pass the visual force page a locally formatted time, but my question is this.  If i am doing a query in my controller and returning that query back to the visual force page to be displayed into a grid, how do i get it as local time?  

 

here is my code, i simplified it here...

 

public PageReference query() {

qryString = 'SELECT Id, account.name,stageName,truck__c,pickupDateTime__c,'+ ' items_to_donate__c, drop_off_location__c,truck_size__c,neighborhood__c FROM Opportunity '+ 'WHERE CloseDate = ' + dateStr1 + ' and '+stageQuery+' ORDER BY truck__c, pickupDateTime__c ASC' ;}

}

queryResult = Database.query(qryString) ;

 

 

then on the front end i have

 

<apex:pageBlockTable value="{!queryResult}" var="a" id="rows" width="50%">

 <apex:column ><apex:facet name="header" ><b>Pickup Time</b></apex:facet>

{!a.PickupDateTime__c} </apex:column>

 </apex:pageBlockTable>

 

any help you guys can offer would be amazing!!