我一直在测试Azure的EventGrid,其中我想要做的事情之一是发送一个事件,其中PayLoad的一部分是DateTimeOffset字段。我正在使用标准的EventGridClient发布事件:
using (var client = new EventGridClient(topicCredentials))
{
await client.PublishEventsAsync(topicHostname, eventGridEvents).ConfigureAwait(false);
}
我已启动 Fiddler 并验证了日期部分的序列化方式,结果如预期: "CheckInDate": "2018-12-26T14:47:42.8-08:00"
但是当我的 Azure Functions 订阅监听器接收 HttpTrigger 并读取消息内容时,同一项却被格式化为 UTC 时间:"CheckInDate": "2018-12-26T22:47:42.8+00:00"。
是否有什么设置或者需要我开启的东西才能保留原始的偏移量呢?