This is a migrated thread and some comments may be shown as answers.

Date and Time functions to UTC time

1 Answer 957 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 10 Feb 2017, 01:20 AM

In the Designing Reports doc, it says:

 Now() Returns the current date and time on the computer processing the report, expressed as the local time.

I have a server to generate the report,  so the Now() = server local time.   Server can be deployed to anywhere ( UTC offset can be any value)

I want to show client local time Now() in the report.  How can I implement it? 

1 Answer, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 13 Feb 2017, 01:35 PM
Hi Jerry,

About dates in Telerik Reporting:
  1. In reports you can use the built-in Today and Now functions, which are evaluated on the server machine where reports are processed and rendered;
  2. When you use the HTML5 Viewer, the user selects local dates which we convert to UTC dates before submitting them to the server.

Thus to avoid displaying the server's time, you can add an Integer report parameter adding the hours to the Now() value. The parameter's value will be the UTC offset.
Other approach will be to use a DateTime report parameter instead of Now() in the expression. The parameter's value can be set in the report's constructor or through the client to an adjusted DateTime value.

We also recommend storing all dates in UTC with offset.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Jerry
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or