web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Can we update input ty...
Power Pages
Unanswered

Can we update input type values on readonly forms

(0) ShareShare
ReportReport
Posted on by 2

There is a date field on the entity form(readonly) which is of input type and it is having a data-behaviour="userlocal" which is showing the date to User local time zone.

I was trying to update the value of this field using jquery attr() and prop() but saw other posts which suggested that it only changes the values in DOM not on UI.

So, I was wondering if there is any way to show the UTC time on this field instead of user local time. (without changing the Date Behavior in schema of field)

In code value for input type is already in UTC time zone but on form(UI) it is showing as user local datetime (i think due the data-behavior="userlocal")

Is there any way to show the UTC value on form or update the input type attributes so that it will only show utc date and time.

 

In Code:

Nitin1337_0-1649837475194.png

 

On UI:

Nitin1337_0-1649849481344.png

 

 

Categories:
  • MOHAMMAD Profile Picture
    105 on at

    @Nitin1337 

    You can try this javascript.

     

     $(document).ready(function(){ 
     // Get field value 
     var stdregistrationclosedatetime = $("#stdregistrationclosedatetime").datepicker({ dateFormat: 'dd,MM,yyyy' }).val(); 
     
     // Convert date
     var registrationclosedatetime = new Date(stdregistrationclosedatetime) 
     
     // Convert UTC 
     var utcDate = registrationclosedatetime.toUTCString();
     
     }); 

     

     

    Regards

    Mohammad

  • N1T1337 Profile Picture
    2 on at

    Hi @Atiour  Thanks for reply. The date value in input type is already in UTC time zone(2022-01-20T09:20:11.0000Z) but I think due to data-behavior="UserLocal" it is displaying user local on UI. I wanted to show this time on the form level but its showing converted time (user local time).

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    Is it still being parsed by the DateTimePicker control? if so, you would probably need to update the control (not sure that it works but the DateTimePicker has locale and timeZone functions, but the other option would be to set the defaultDate) 

     

    // if it is being parsed by the the datetime picker 
    // you can see the functions that are exposed by putting the following into your browsers F12 console
    $("#your_fieldname") // input control
     .next() // the date picker container
     .data("DateTimePicker") // the date picker object
     );

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 47

#2
M Bilal Khan Profile Picture

M Bilal Khan 44

#3
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

Last 30 days Overall leaderboard