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

前端 未结 8 1781
臣服心动
臣服心动 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条回答
  •  猫巷女王i
    2021-01-01 14:40

    We actually have a reporting solution where dates and times can be passed in as plain text CCYYMMDD and hhmmss values then, when the code needs to do anything to those values, it simply uses string operations to turn them back into a format that can be displayed or easily parsed (such as the DB2 ISO formats CCYY-MM-DD or hh.mm.ss).

    The result is readable and I'd be surprised if .NET didn't have string manipulation instructions that could do this easily.

提交回复
热议问题