Is there a standard date/time format that can be passed on a URL?

前端 未结 8 1730
臣服心动
臣服心动 2021-01-01 13:51

Looking at the DateTimeFormatInfo documentation, it appears that all the standard formats have colons in them, which makes passing them on a url unpleasant/impossible.

相关标签:
8条回答
  • 2021-01-01 14:49

    It's probably not part of any standard or anything like that, but you could always use a Unix timestamp as those only contain digits. See this article for ways to convert it to a .NET DateTime.

    0 讨论(0)
  • 2021-01-01 14:51

    Yes. ISO 8601

    http://en.wikipedia.org/wiki/ISO_8601

    Just make sure you URLEncode it to deal with the colons.

    0 讨论(0)
提交回复
热议问题