Trim Milliseconds - CSharp System

CSharp examples for System:DateTime Second

Description

Trim Milliseconds

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from w  ww.  j  a  v  a  2 s.c  o  m

public class Main{
        public static DateTime TrimMilliseconds(this DateTime self) {
         var dt = new DateTime(self.Year, self.Month, self.Day, self.Hour, self.Minute, self.Second, self.Kind);
         return dt;
      }
}

Related Tutorials