To Year Month Day Hour Minute Second Format - CSharp System

CSharp examples for System:DateTime Year

Description

To Year Month Day Hour Minute Second Format

Demo Code

// Copyright (c) Microsoft Corporation. All rights reserved. 
using System;/*  w  ww  . j  a v a2s.c  om*/

public class Main{
        public static string ToYearMonthDayHourMinuteSecondFormat(this DateTime dateTime)
        {
            return dateTime.ToString("yyyy-MM-dd HH:mm:ss");
        }
}

Related Tutorials