Date/Time Format Showing Wrong


hopefully someone can help me. i am currently having an issue where when i enter a date and time it shows up wrong on the sharepoint form.

see pictures below



Hey @Jacob_Simons,

It would be great to get some more context.

  • Do the date and time display correctly in the Sharepoint list?
  • Are you using the Date Picker field?
  • Does your form have any custom JavaScript?

Could you send me a link to your form so I can reproduce the issue?

Howdy, thanks for the response

It has a lookup field that is looking up dynamically when certain items are selected.

The top image is the form and the bottom image is the SharePoint list thats the form is looking up from.

Unfortunately i cant send you a link sorry.

I can send a picture of my Java Script if you would like?

Hey @Jacob_Simons,

Thanks for the added context!
A picture of your JavaScript code would be great.

Hey @Jacob_Simons,

I still can't reproduce the issue. Try replacing

fd.field('CourseStartDate').value = fd.control('TrainingCourseTitle').value.CourseDate;


fd.field('CourseStartDate').value = new Date(fd.control('TrainingCourseTitle').value.CourseDate).toLocaleDateString('en-us', { year:"numeric", month:"numeric", day:"numeric"});

Let me know if this helps.

Hey @Jacob_Simons,

I've noticed that you removed the screenshot of your code. Could you post it again?
(Maybe not the entire thing, just the function that assigns value to CourseStartDate and similar fields)

I'm asking because the full context of the conversation could be useful for the other community members.

If you can't share the code, it's completely fine, but I'd recommend writing to if you need to deal with a similar confidential matter in the future.