When I am invoicing the Sales Order the time printed on Invoice is worng.it shows 3 hours early time.suppose I created and posted invoice at 01:02 pm then time was printed 10:02 am.
It might mean that the report doesn't correctly apply time zone of the current user, or maybe that the current user uses a different time zone than the local one.
Dear Mr.Martin,all users receive the same problem across different domain.time zone of all users are same
the only difference is system showing UTC where as user showing GMT.
If you think that my second idea isn't applicable, consider my first idea ("it might mean that the report doesn't correctly apply time zone of the current user").
this is what printed in a report
text=datetime2str(CustInvoiceJour.createdDateTime); //here createddatetime in the database also shows 3 hours less
I change to the following line
but still the reports shows the same time.
The problem is in your code - you forgot to apply user's time zone.
You can use this:
localDateTime = DateTimeUtil::applyTimeZoneOffset(dateTimeInUct, DateTimeUtil::getUserPreferredTimeZone());
Thank you very much.working.
text =datetime2str (DateTimeUtil::applyTimeZoneOffset(CustInvoiceJour.createdDateTime, DateTimeUtil::getUserPreferredTimeZone()));