Re: How to convert TimeZone in fiddler

268 views
Skip to first unread message

EricLaw

unread,
Jul 24, 2012, 2:20:56 PM7/24/12
to httpf...@googlegroups.com
FiddlerScript is written in JScript.NET, not C#, so you don't declare variables like that.
 
The first thing to fix is this:
 
   var pstZone : TimeZoneInfo  = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");

On Tuesday, July 24, 2012 5:39:07 AM UTC-7, R_MAL wrote:
Hi,

I want to know if it is possible to convert the local time shown by fiddler to customized timezone? I tried changing the CustomRules.js file to get the information but I am always getting this error, please refer to the screenshot attached.

This is what I added in the Rules file:

TimeZoneInfo pstZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
var tzStr = pstZone.IsDaylightSavingTime(oSessions[x].Timers.ClientBeginRequest) ? pstZone.DaylightName : pstZone.StandardName;
var startPacific = TimeZoneInfo.ConvertTime(oSessions[x].Timers.ClientBeginRequest, TimeZoneInfo.Local, pstZone);
var endPacific = TimeZoneInfo.ConvertTime(oSessions[x].Timers.ClientDoneResponse, TimeZoneInfo.Local, pstZone);

Please help me.

Thanks in advance

EricLaw

unread,
Jul 27, 2012, 3:44:15 PM7/27/12
to httpf...@googlegroups.com
TimeZoneInfo is a class that was introduced in .NET3.5. Are you sure you're running on a machine with .NET3.5? Did you remember to add System.Core to the imports clause at the top of your script?
 

On Thursday, July 26, 2012 12:02:08 AM UTC-7, R_MAL wrote:
Thanks Eric for the suggestion. But I am still facing the same issue:"Variable TimeZoneInfo" has not been declared.
PFA, the screenshot and the attached script.

Any help will be really appreciated.

Thanks
Reply all
Reply to author
Forward
0 new messages