Ravindar, Biztalk Developer and Administrator

Just another BizTalk blog

Limitations of making dateTime field as distinguished in BizTalk

I came across an issue related to DateTime conversion yesterday. The Datetime was coming 10hours ahead than expected. Although the value was being passed correctly , it was receiving 10hours ahead time and this revealed a strange behaviour of BizTalk while assigning dateTime fields.

 

The root issue was the DateTime field was a distinguished filed and when the value is being assigned in orchestration, it automatically converts to UTC But the Time zone is lost. In this case, BizTalk does not behave as expected, although you pass local time, when the value is assigned to a distinguished datetime filed.

 

The behaviour is clearly elaborated  here  http://www.malgreve.net/2012/10/03/datetime-xml-element-converted-to-utc-how-to-read-the-original-time-of-a-different-time-zone/

In c# it will work fine, but in Biztalk Orchestration if we assign value to distinguished dateTime field, the Time zone will be lost.

 

Ultimately to read the correct value, we had to use the method DateTime.SpecifyKind(param1, DateTimeKind.Local);   to get the correct time.

 

So firstly it’s good to avoid making the datetime fields as distinguished, otherwise if it is mandatory to make a datetime filed as distinguished, please keep this limitation in mind and use the above method to get the desired output.

Advertisements

August 30, 2017 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: