Local TimeZone

Stimulsoft Reports.WEB discussion
Post Reply
jkoo
Posts: 64
Joined: Fri Aug 19, 2011 8:08 pm

Local TimeZone

Post by jkoo »

1. Is there any way to get local time (that is, the machine run web browser) rather than server time (webserver)?

System variable {Date} {Time} returns server time.

2. It looks like report control is binding C#2.0 rather than 3.5.
So I think TimeZoneInfo (which is defined at 3.5) cannot be recognized in the script.
Is there any solution for this?

Thanks
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Local TimeZone

Post by HighAley »

Hello.
jkoo wrote:1. Is there any way to get local time (that is, the machine run web browser) rather than server time (webserver)?

System variable {Date} {Time} returns server time.
The report is rendered on server and it's impossible to get client time. You should get it by yourself, for example, using JavaScript.
jkoo wrote:2. It looks like report control is binding C#2.0 rather than 3.5.
So I think TimeZoneInfo (which is defined at 3.5) cannot be recognized in the script.
Is there any solution for this?
You could use our controls with .NET Framework 2.0 and higher. Please, change target .NET Framework version in your project.

Thank you.
jkoo
Posts: 64
Joined: Fri Aug 19, 2011 8:08 pm

Local TimeZone

Post by jkoo »

My target NET framework is 3.5
But System.TimeZoneInfo cannot be recognized at the report.
It's little strange.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Local TimeZone

Post by HighAley »

Hello.
jkoo wrote:My target NET framework is 3.5
But System.TimeZoneInfo cannot be recognized at the report.
It's little strange.
Please, specify where are you trying to use System.TimeZoneInfo class.

Thank you.
jkoo
Posts: 64
Joined: Fri Aug 19, 2011 8:08 pm

Local TimeZone

Post by jkoo »

I want to display local time.

{DateTime.UtcNow} works fine.

But the below is getting compile error.

{TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Local,TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time"))}


Please refer to the attached.
Attachments
1819.TimeZoneInfo.png
1819.TimeZoneInfo.png (34.97 KiB) Viewed 4267 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Local TimeZone

Post by HighAley »

Hello.
jkoo wrote:I want to display local time.

{DateTime.UtcNow} works fine.

But the below is getting compile error.

{TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Local,TimeZoneInfo.FindSystemTimeZoneById("Tokyo Standard Time"))}


Please refer to the attached.
Please, add the System.Core.Dll to the Referenced Assemblies list of the Report.

Thank you.
Attachments
1822.System.Core.png
1822.System.Core.png (45.65 KiB) Viewed 4258 times
Post Reply