function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
John L.John L. 

Visualforce, JavaScript, and localization

I've a Visualforce code snippet that retrieves the week number of a Apex timestamp attribute:
 
<apex:outputText id="currweek" style=" align : center ; " value="W{0,date,w}">
  <apex:param value="{!tk.StopTime__c}"/> 
</apex:outputText>

However, the timestamp is GMT, not localized. I'm GMT+5, so I get the wrong results after 7pm Saturdays.

The documentation suggests using $A.localizationService.formatDate(...), but placing it around the 0, or around the param value attribute don't pass the editor syntax checks.

Thanks in advance for any clarity you can provide.​​​​​​​
Best Answer chosen by John L.
HarshHarsh (Salesforce Developers) 
Hi John,

Please check the stack Exchange link for the same.

https://salesforce.stackexchange.com/questions/266502/localizationservice-formatdatetime-method-is-not-displaying-correct-time-in-euro 

Related Link
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cb_format_dates.htm

I hope your question is answered above.

Please mark it as Best Answer if the above information was helpful.

Thanks.