I have a data table which contains a column in datetime(UTC Timezone) data type. I want to convert this datetime data column to IST timezone DateTime. I don’t want to use loop to do this conversion. because huge number of rows need to be processed which will take more time. I want to do this conversion for a whole column without using loop. Please can anyone tell me how to do that.
Basically want to convert a data column date time to IST timezone data time.
Thanks!
The steps to achieve is as follows:
1.Declare a variable of type Time Zone Info (TZI)
2.Add an assign activity to set IST as Time Zone Info
i.e. TZI = TimeZoneInfo.FindSystemTimeZoneById(“India Standard Time”)
3.Use Invoke code activity and Pass your data table as argument
Inside invoke code have the below code written datatable.AsEnumerable.ToList.ForEach(Sub(x) X(“DateColumn”) = TimeZoneInfo.ConvertTimeFromUtc(X(“DateColumn”).ToString, TZI ) )
I am using this code in invoke code activitt dtSample.AsEnumerable.ToList.ForEach(Sub(x) X(“doj”) = TimeZoneInfo.ConvertTimeFromUtc(convert.ToDateTime(X(“doj”)),TimeZoneInfo.FindSystemTimeZoneById(“India Standard Time”))).
And passing an data table in argument as dtSample. Still i am getting the error ->>> Invoke code: Exception has been thrown by the target of an invocation.