Skip to main content
16-Pearl
April 19, 2023
Question

how to hardcode time in datepicker widget where date can be selected by user

  • April 19, 2023
  • 1 reply
  • 1941 views

While fetching selected date from datepicker widget, i want to hardcode time as 23:59:59.000.

For example if 23/03/2022 is selected in datepicker widget means, while storing data i want tostore as 23/03/2022 23:59:59.000 in datatable. It should work correctly in all timezones. how to do this?

1 reply

16-Pearl
April 20, 2023

Hi @AP_10343008 ,

 

Can you please try with the JS function of " setHours (23, 59, 59, 000) " when you are storing the data in your service.

It may help you.

Arun_C_2-1681961545400.png

 

 

Thanks & Regards,

Arun C

16-Pearl
April 20, 2023

For me, output time is changing based on timezone offset. I dont want this to be happened.

AP_10343008_0-1681984565037.png

 

17-Peridot
April 20, 2023

Hello @AP_10343008,

 

I believe Thingworx will always convert from UTC to your local time in the output of the composer.

There is however some ways to get around it looking at this support article.

 

So perhaps you can try to use some of the steps there to get your service to work properly.

 

Regards,

Jens