日期时间字符串中的时区

Timezone in datetime string

我在 XML 文件中有以下字符串:

<Platform FeedLastUpdated="2017-03-29 19:37:05">Whosebug</Platform>

用 UTC tz 表示的最佳方式是什么?例如:

"2017-03-29 19:37:05 UTC"

是否有我们应该使用的标准方法?

您的格式已经非常接近 ISO 8601 及其同类 RFC 3339;通过使用 T 而不是 作为分隔符,你就在那里。 ISO 8601 和 RFC 3339 指定时区偏移量(或 Z 用于 UTC),如下所示:

2017-03-29T19:37:05+00:00 # UTC
2017-03-29T19:37:05-05:00 # New York time
2017-03-29T19:37:05Z      # Shortcut for UTC