zoukankan      html  css  js  c++  java
  • Custom date and time format strings

    Custom date and time format strings

    The "fff" custom format specifier

    The "fff" custom format specifier represents the three most significant digits of the seconds fraction; that is, it represents the milliseconds in a date and time value.

    The following example includes the "fff" custom format specifier in a custom format string.

    The "ffff" custom format specifier

    The "ffff" custom format specifier represents the four most significant digits of the seconds fraction; that is, it represents the ten thousandths of a second in a date and time value.

    Although it's possible to display the ten thousandths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT version 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

    The "K" custom format specifier

    The "K" custom format specifier represents the time zone information of a date and time value. When this format specifier is used with DateTime values, the result string is defined by the value of the DateTime.Kind property:

    For DateTimeOffset values, the "K" format specifier is equivalent to the "zzz" format specifier, and produces a result string containing the DateTimeOffset value's offset from UTC.

    If the "K" format specifier is used without other custom format specifiers, it's interpreted as a standard date and time format specifier and throws a FormatException. For more information about using a single format specifier, see Using Single Custom Format Specifiers later in this article.

    The following example displays the string that results from using the "K" custom format specifier with various DateTime and DateTimeOffset values on a system in the U.S. Pacific Time zone.

  • 相关阅读:
    比赛F-F Perpetuum Mobile
    HDU 1003(A
    C-C Radar Installation 解题报告
    Codeforces 18C C. Stripe
    HDU 4911 Inversion
    分蛋糕(C
    抄书(B
    深入了解Android蓝牙Bluetooth——《基础篇》
    2W 字详解 Redis 集群环境搭建实践
    漫画 | 阿姨,我不想努力了~
  • 原文地址:https://www.cnblogs.com/chucklu/p/13230208.html
Copyright © 2011-2022 走看看