Example1
var dt = DateTime.Now; // 10/1/2010 10:44:24 AM
var dateOnly = dt.Date; // 10/1/2010 12:00:00 AMExample2
DateTime now = DateTime.Now;
DateTime today = now.Date;Example3
DateTime now = DateTime.Now;
DateTime today = new DateTime(now.Year, now.Month, now.Day);
Saturday, October 2, 2010
c# DateTime, Trim without converting to string
ป้ายกำกับ:
C# DateTime
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment