Hello,
I'm using the Web Report Designer with the ".repx" report format.
In my SQL-Server database, I'm storing dates with UTC "DateTimeOffset" type:
Example :
In the report, I simply want to display a date as Local date.
I tried to use this expression but it doesn't work, as my field is a DateTimeOffset and not a DateTime :
AddHours([MyDateValue],DateDiffHour(UtcNow(), LocalDateTimeNow()))
Is there a solution to simply calculate the local date using a calculated field ? If I want to use this expression, I need to convert the DateTimeOffset to a DateTime…
thank you,
best regards.
It seems that this expression show the local date, I don't even know why:
FormatString( '{0:dd.MM.yyyy HH:mm:ss}', AddSeconds(AddMinutes(AddHours(GetDate(ToStr( [OperationDate] )),GetHour(ToStr( [OperationDate] )) ) , GetMinute(ToStr( [OperationDate] ))) , GetSecond(ToStr( [OperationDate] ))) )
Before :
After .
Is there a better solution ?