Date To Date Time String - CSharp System

CSharp examples for System:DateTime Format

Description

Date To Date Time String

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from w ww  . j av a2 s.com

public class Main{
        public static string DateToDateTimeString(DateTime dateTime)
        {
            return string.Format("{0}{1}{2}", dateTime.ToString("d"), Environment.NewLine, dateTime.ToString("t"));
        }
}

Related Tutorials