Format Date Time, yyyy-MM-dd HH:mm:ss - CSharp System

CSharp examples for System:DateTime Format

Description

Format Date Time, yyyy-MM-dd HH:mm:ss

Demo Code


using System.Text;
using System.Web.UI;
using System;/*from www  .  j av  a 2s. c o  m*/

public class Main{

    public static string FormattedDateTime(this DateTime time)
    {
        return time.ToString("yyyy-MM-dd HH:mm:ss");
    }
}

Related Tutorials