How to convert UK timezone to IST format

Hi,

The system timezone is UK, and I need to convert it into IST time zone.

I have tried this
System.TimeZoneInfo.ConvertTime(Now,TimeZoneInfo.FindSystemTimeZoneById(“India Standard Time”))

But i got the below error

Message Box: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

Can any one help me?

@rnahasnahasuddin,

This happens due to symbol in the expression. Try typing the expression manually or use this one

System.TimeZoneInfo.ConvertTime(Now,TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"))

Hi @rnahasnahasuddin

Please check “Now” returns the current system time (which is in your UK time zone, based on your system’s settings).

convertedTime = System.TimeZoneInfo.ConvertTime(Now, TimeZoneInfo.FindSystemTimeZoneById(“India Standard Time”))

Or You should restart the UiPath or recompile.

Happy Automation!

1 Like

Hi @rnahasnahasuddin

‘VisualBasicValue '1’ requires compilation in order to run. Please ensure that the workflow has been compiled.: This error occurs when your double quotes aren’t typed properly like " ".

Retype the syntax as below:

System.TimeZoneInfo.ConvertTime(Now,TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"))

Hope it helps!!

1 Like

ukTime = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.Utc, TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"))

DateTime istTime = TimeZoneInfo.ConvertTime(ukTime, TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time"), TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.