2

I have a UI:inputDateTime component, and the user can select date and time.

enter image description here

If I choose 12:00am, the output of the value attribute is in the following format:

2018-02-14T08:00:00.000Z

Why does the time get altered. It looks like the component is adding +8 hours; why does this occur and how can I handle that to literally get exactly the time that the user enters in the picker?

I believe my org is in CST.. my computer is in CST.. I don't really understand what is happening

4
  • Because the value you see in the date picker is the formatted time the actual time that's used in the backend is the gmt time
    – Aequitas
    Feb 16, 2018 at 0:16
  • although, cst and gmt is only 6 hours apart, so not sure why your example is 8 hours difference.
    – Aequitas
    Feb 16, 2018 at 0:22
  • Can confirm, Salesforce converts my input to GMT as well, since it is the timezone in which the records are saved on the database. Maybe the timezone is set to CST on OP's computer, but he's actually in a different timezone? Feb 16, 2018 at 0:29
  • oh you mentioned the org is in cst, but that's not what is used, its the user time zone that is used when formatting.
    – Aequitas
    Feb 16, 2018 at 1:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.