zoukankan      html  css  js  c++  java
  • string.Format 格式化输出日期

    string.Format("{0:d}",System.DateTime.Now) 结果为:2009-3-20 (月份位置不是03)

    string.Format("{0:D}",System.DateTime.Now) 结果为:2009年3月20日

    string.Format("{0:f}",System.DateTime.Now) 结果为:2009年3月20日 15:37

    string.Format("{0:F}",System.DateTime.Now) 结果为:2009年3月20日 15:37:52

    string.Format("{0:g}",System.DateTime.Now) 结果为:2009-3-20 15:38

    string.Format("{0:G}",System.DateTime.Now) 结果为:2009-3-20 15:39:27

    string.Format("{0:m}",System.DateTime.Now) 结果为:3月20日

    string.Format("{0:t}",System.DateTime.Now) 结果为:15:41

    string.Format("{0:T}",System.DateTime.Now) 结果为:15:41:50

  • 相关阅读:
    JSON
    FBV & CBV
    django Tips
    Django2.2
    cookie & session
    ajax请求
    视图函数
    模板语法
    模板继承、组件
    python之路-----多线程与多进程
  • 原文地址:https://www.cnblogs.com/volts0302/p/5244955.html
Copyright © 2011-2022 走看看