FORMAT_DATE adjusting for timezone when applied against DATE field

  • 2
  • Problem
  • Updated 2 years ago
  • Acknowledged
  • (Edited)
When applying FORMAT_DATE function to a DATE field, the resulting output is adjusting the DATE based on the timezone.

Note - This might be related to https://community.skuidify.com/skuid/topics/datetime-field-not-converting-correctly-based-on-user-ti...

Steps to Reproduce:
1) Add field "Test_Date__c" to Account object as a DATE field
2) Set SFDC timezone setting to make sure you are on a prior day from 00:00 GMT
2) Create page using XML below
3) Preview page

Expected Behavior
Test_Date__c == Formatted Date

Actual Behavior
Test_Date__c is correct
Formatted Date has adjusted for timezone (mine is PDT)

Sample Page XML
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account">   <models>
      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account" adapter="" type="">
         <fields>
            <field id="Name"/>
            <field id="CreatedDate"/>
            <field id="FormattedDate" uionly="true" displaytype="FORMULA" label="Formatted Date" readonly="true" returntype="TEXT">
               <formula>FORMAT_DATE('mm/dd/yy', {{Test_Date__c}})</formula>
            </field>
            <field id="Test_Date__c"/>
         </fields>
         <conditions>
            <condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
         </conditions>
         <actions/>
      </model>
   </models>
   <components>
      <pagetitle model="Account" uniqueid="sk-3QEmlF-70">
         <maintitle>
            <template>{{Name}}</template>
         </maintitle>
         <subtitle>
            <template>{{Model.label}}</template>
         </subtitle>
         <actions>
            <action type="savecancel" window="self"/>
         </actions>
      </pagetitle>
      <basicfieldeditor showsavecancel="false" showheader="true" model="Account" mode="read" uniqueid="sk-3QEmlF-71">
         <columns>
            <column width="100%">
               <sections>
                  <section title="Basics">
                     <fields>
                        <field id="Name"/>
                        <field id="Test_Date__c" valuehalign="" type=""/>
                        <field id="FormattedDate" valuehalign="" type=""/>
                     </fields>
                  </section>
               </sections>
            </column>
         </columns>
      </basicfieldeditor>
   </components>
   <resources>
      <labels/>
      <css/>
      <javascript/>
   </resources>
   <styles>
      <styleitem type="background" bgtype="none"/>
   </styles>
</skuidpage>
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 2
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Barry~

Thanks for alerting us of this bug. The devs are aware of it and will consider it for a future release.

Thanks for helping us make Skuid better!
Karen