I have created a custom integration with another system to create invoice journals in Dynamics 365 Finance. In development environments (tested in 2 DEVs environments) the invoice date is correct, but in UAT environments the invoice date is less one day.
DEV environment in LCS (right date)

UAT environment in LCS (wrong date)

I'm using the code (DateTimeUtil::date(invoiceDate) to get the date.
Anyone know what is wrong?