CSharp examples for System:DateTime Format
DateTime To Local String
using System;/*w w w. java2 s .com*/ public class Main{ public static string ToLocalString(this DateTime? value, string format = null) { if (value == null) return ""; var date = value.Value.ToLocalTime(); if (format != null) { return date.ToString(format); } return date.ToString(); } }