asp.net 各种格式的时间格式

   //2011年10月31日

        this.Label6.Text = System.DateTime.Now.ToString("D");

        //2011-10-31

        this.Label7.Text = System.DateTime.Now.ToString("d");

        //2011年10月31日 16:10:15

        this.Label8.Text = System.DateTime.Now.ToString("F");

        //2011年10月31日 16:10

        this.Label9.Text = System.DateTime.Now.ToString("f");

        //2011-10-31 16:10:15

        this.Label10.Text = System.DateTime.Now.ToString("G");

        //2011-10-31 16:10

        this.Label11.Text = System.DateTime.Now.ToString("g");

        //16:10:15

        this.Label12.Text = System.DateTime.Now.ToString("T");

        //16:10

        this.Label13.Text = System.DateTime.Now.ToString("t");

        //2011年10月31日 8:10:15

        this.Label110.Text = System.DateTime.Now.ToString("U");

        //2011-10-31 16:10:15Z

        this.Label15.Text = System.DateTime.Now.ToString("u");

        //10月31日

        this.Label16.Text = System.DateTime.Now.ToString("m");

        this.Label16.Text = System.DateTime.Now.ToString("M");

        //Tue, 31 Apr 2011 16:10:15 GMT

        this.Label17.Text = System.DateTime.Now.ToString("r");

        this.Label17.Text = System.DateTime.Now.ToString("R");

        //2011年10月

        this.Label19.Text = System.DateTime.Now.ToString("y");

        this.Label19.Text = System.DateTime.Now.ToString("Y");

        //2011-10-31T15:52:19.1562500+08:00

        this.Label20.Text = System.DateTime.Now.ToString("o");

        this.Label20.Text = System.DateTime.Now.ToString("O");

        //2011-10-31T16:10:15

        this.Label18.Text = System.DateTime.Now.ToString("s");

        //2011-10-31 15:52:19

        this.Label21.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");

        //2011年10月31 15时56分108秒

        this.Label22.Text = System.DateTime.Now.ToString("yyyy年MM月dd HH时mm分ss秒");

        //星期二, 四月 31 2011

        this.Label1.Text = System.DateTime.Now.ToString("dddd, MMMM dd yyyy");

        //二, 四月 31 '11

        this.Label2.Text = System.DateTime.Now.ToString("ddd, MMM d \"'\"yy");

        //星期二, 四月 31

        this.Label3.Text = System.DateTime.Now.ToString("dddd, MMMM dd");

        //10-11

        this.Label10.Text = System.DateTime.Now.ToString("M/yy");

        //31-10-11

        this.Label5.Text = System.DateTime.Now.ToString("dd-MM-yy");

原文地址:https://www.cnblogs.com/wifi/p/2231844.html