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
Ryan Mason 5Ryan Mason 5 

Visualforce Page format field timezone

Can anyone help format a timezone in my VFP? I am newer to visualforce and was assigned this. This is a custom VFP used to customize our related lists. Here is the code for my hover:

                <apex:column styleClass="{!IF(arw.shouldHighlight,'highlight','')}">
                    <apex:facet name="header">Medication<br />Name</apex:facet>
                    <apex:outputLink rel="medDisplayImage"
                        html-data-ndc="{!arw.cm.NDC__c}"
                        html-data-rxnumber="{!arw.cm.Rx_Number__c}"
                        html-data-packsize="{!arw.cm.Pack_Size__c}"
                        html-data-reqresults="{!arw.cm.Refill_Request_Results__c}"
                        html-data-lastescript="{!arw.cm.MD_Last_Escript_Fax_Date__c}"
                        html-data-lastcall="{!arw.cm.MD_Contact_Last_Call_Date__c}"
                        html-data-patcont="{!arw.cm.Patient_Contacted__c}"
                        html-data-rphauth="{!arw.cm.RPH_Authorization_Date__c}"
                        html-data-reqoutcome="{!arw.cm.Refill_Request_Outcome__c}"            
                        value="{!URLFOR($Action.Current_Medication__c.View, arw.cm.Id)}">{!arw.cm.Name}</apex:outputLink>
                </apex:column>


_______________________________________________________________________
j$(document).tooltip({
        items: 'a[rel="medDisplayImage"]',
        container : 'body',
        track: true,
        content: function(callback) {
            var element = jQuery(this);
            var ndc = element.data('ndc');
            var rxNum = element.data('rxnumber');
            var packsize = element.data('packsize');
            var reqresults = element.data('reqresults');
            var lastescript = element.data('lastescript');
            var lastcall = element.data('lastcall');
            var patcont = element.data('patcont')
            var rphauth = element.data('rphauth')
            var reqoutcome = element.data('reqoutcome')

            
            //lastescript = lastescript.format('yyyy-MM-dd\'T\'HH:mm:ss\'Z\'');
            

            if(lastcall) {
                lastcall = lastcall.toLocaleString();
            }
let retString = '<img class="medImage" alt="" src="https://example.com/FDB_DrugDrug_Interactions/drugImage.php?drug_ndc='+ndc+'"><br /><div style="text-align:center;font-size:small;"><strong>Pack Size: '+packsize+'</strong></div><br /><div style="text-align:left;font-size:small;"><strong>MD Last Escript Fax Date: </strong>'+lastescript+'</div><br /><div style="text-align:left;font-size:small;"><strong>MD Contact Last Call Date: </strong>' + lastcall + '</div><br /><div style="text-align:left;font-size:small;"><strong>Patient Contacted: </strong>'+patcont+'</div><br /><div style="text-align:left;font-size:small;"><strong>Refill Request Outcome: </strong>' + reqoutcome + '</div><br /><div style="text-align:left;font-size:small;"><strong>Refill Request Results: </strong>' + reqresults + '</div><br /><div style="text-align:left;font-size:small;"><strong>RPH Authorization Date: </strong>' + rphauth + '</div>';


The issue is that my output displays in GMT. I want it to display in org's default (Eastern time) OR I want to remove the time altogether and just display the date. Also, Is there a way I can only display the Field if there is a value stored? See pic for example you'll see the GMT time zones & the last field is NULL.
User-added image
Baya AdamBaya Adam
Information Transformation Service provides  web scraping Services that provides high-quality structured data to improve business outcomes and enable intelligent decision making,their Web scraping service allows you to scrape data from any websites and transfer web pages into an easy-to-use format such as Excel, CSV, JSON and many others.