We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Date filter using incorrect timezone

I'm using the report viewer embedded via an Iframe.  My report has a date filter which has the default value expression of "Today()" however this is returning yesterdays date (I suspect UTC date) however my timezone is New Zealand (UTC + 13).  I can see in the network request that this date has already been calculated when I request the report from the server.  I've set my timezone to New Zealand inside the syncfusion settings and I've tried setting the report language to en-NZ however neither has worked.

Is there somewhere I can tell syncfusion reports which timezone to use for my filters?

Cheers.

3 Replies

VS Vinoth Srinivasan Syncfusion Team November 15, 2019 06:24 AM

Hi Hayden, 

We need to follow the below steps to render the date based on your culture in your Application. We have provided en-AU culture as example. 
  
1.Ensure to stop the Report Server application from the desktop shortcut – “Stop Syncfusion Report Server”. 

2.Download your required culture script from the below link. 

3.Paste the downloaded culture script file only into the below locations as shown in below snap. 
{{InatalledLocation}}:\Program Files (x86)\Syncfusion\Report Server\ReportServer.Web\ Scripts\EssentialJS\i18n\ 
{{InatalledLocation}}:\Syncfusion\Report Server\ReportServer.Web\  Scripts\EssentialJS\i18n\ 
 
 
4.Paste the downloaded localetext script file only into the below locations as shown in below snap. 
 {{InatalledLocation}}:\Program Files (x86)\Syncfusion\Report Server\ReportServer.Web\ Scripts\Localization\reportviewer 
{{InatalledLocation}}:\Syncfusion\Report Server\ReportServer.Web\ Scripts\Localization\reportviewer 
 

5. Refer the pasted file reference in to “ReportViewer.cshtml” file like below from the below locations as shown in below code example and snap. 
    {{InatalledLocation}}:\Program Files (x86)\Syncfusion\Report Server\ReportServer.Web\Views\FileRender 
    {{InatalledLocation}}:\Syncfusion\Report Server\ReportServer.Web\Views\FileRender 

ReportViewer.cshtml
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
    <meta name="viewport" content="width=device-width" /> 

    <link rel='nofollow' href="@Url.Content("~/Content/Styles/EssentialJS/reportviewer/bootstrap-theme/ej.reportviewer.min.css")" rel="stylesheet" type="text/css" /> 
     
    @Styles.Render(DeviceDetection.IsMobile ? "~/styles/file-render-report-mobile" : "~/styles/file-render-report") 
    @Scripts.Render(DeviceDetection.IsMobile ? "~/scripts/report-render-mobile" : "~/scripts/report-render") 

              <script src="~/Scripts/EssentialJS/i18n/ej.culture.@string.Concat(language,".min.js")"></script> 
        var getLinkReportName = "@ViewBag.ItemName"; 
    </script> 
 
 
 
 
6. create the en-AU folder add messages.po file to load the server with culture in below server installed locations as shown in below snap. 
{{InatalledLocation}}:\Program Files (x86)\Syncfusion\Report Server\ReportServer.Web\ locale 
{{InatalledLocation}}:\Syncfusion\Report Server\ReportServer.Web\locale 
 

Please find the below en-AU folder with messages.po file. 

7. Start the Report Server Application from the desktop shortcut – “Start Syncfusion Report Server”. 

8. Click the culture button in server and change the culture to Australia as shown in below snap. 
 
Output snap: 
 

Please let us know if you need any clarification. 

Regards, 
Vinoth S. 



HH Hayden Harrison November 17, 2019 03:40 PM

I've previously done the first half of these steps to get my date to format in the correct order for NZ (dd/mm/yyyy) which works fine but my issue now is the actual timezone seems to be wrong. i.e. the control shows yesterdays date as New Zealand is UTC + 12. I've set my timezone to NZ in the report server settings to no avail.  Can you confirm these steps below will make the report date picker use the correct timezone?  I don't see anything in these files that specifies the timezone to use.    


MS Mahendran Shanmugam Syncfusion Team November 18, 2019 04:53 AM

Hi Hayden, 

We suspect you are getting timezone issue when choosing the datatime value from parameter block. So you can follow the previously shared steps and instead of en-AU could you please use the en-NZ. Please find the below attached files for your reference. 

Let us know if you need any clarification. 

Regards, 
Mahendran S. 


Loader.
Live Chat Icon For mobile
Up arrow icon