DateTime dt = DateTime.Now
dt.Date is created to 31.10.2012 00:00:00 .it is created to dd.mm.yyyy format but i need dd/mm/yyyy. Can i use: return new DateTime(d.Year, d.Month, d.Day, 0, 0, 0); it will create to me dd/mm/yyyy solution?Please dont translate String.i need datetime…
DateTime dt = DateTime.Now dt.Date is created to 31.10.2012 00:00:00 .it is created to
Share
The
DateTimestruct doesn’t store any formatting information internally. If you want to output theDateTimeinstance as a formatted string, you just need to callToString()with the proper format string:If you need more information on exactly which specifiers to use in your format string, check out:
MSDN – Custom Date and Time Format Strings