Hi,
the table contains a DateTime field and in most cases it is the time of record creation. To simplify data entry for users, I want to pre-fill this field for a new record. I used the following onLoad script:
const praveTed = new Date();
doo.model.datumACas.value = praveTed;
doo.toast.info(praveTed);
The field is inserted with a time one hour higher (+1) than the current time. But the info toast with the output of the same variable prints the correct current date and time (see attached screenshot).
Where is the error? How to write the correct time into the field using a script?
The application time zone is set to Europe/Prague.
THANKS, it works…
But why? I assume that the values are stored in the db in UTC and when displayed are adjusted according to the time zone set for the application. But when writing to the field using the script doo.model.datumACas.value = praveTed; is it necessary to use hard UTC time, but without the UTC zone designation (Z at the end)?
Do I understand this correctly?