Hello,
using the Now() Function in a calculation stage I get the representation of Date an Time in UTC.
But what is, when I already have an UTC-Datetime and after all calculation is done I like to convert this to Local Date Time for user output.
How can I accomplish this?
I know, that there are two other functions in a calculation stage UTCTime() and LocalTime() but they are only returning a Time-Value without the date part. And what I need is both - Date and Time.
I also tried doing this in a code stage.
For example:
------
DateTime dtutc;
DateTime dtlocal;
TimeZoneInfo infoLocal = TimeZoneInfo.FindSystemTimeZoneById("Central European Standard Time");
dtutc = DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Utc);
dtlocal = TimeZoneInfo.ConvertTimeFromUtc(dtutc, infoLocal);
Console.WriteLine(dtutc.ToString());
Console.WriteLine(dtlocal.ToString());
----
This code works perfectly at home on my private PC, because the difference between UTC and Local-Time
is exactly the 2 hour difference from UTC to the time in my country.
But the same code - exception Console WriteLine - in Blue Prism I get exactly the same value for UTC an Local Time.
Why is this? What am I missing?
Thanks