Other than DateTime ctor (new DateTime (year, month, day)), is there any other way to truncate the date?
DateTime.Date
Returns only the date component (time is midnight).
DateTime.Now.ToShortDateString();
In addition, ToString () is overloaded in DateTime, you can pass several dozen formatting options to it.
See: http://authors.aspalliance.com/aspxtreme/sys/demos/datetimeformats.aspx
Source: https://habr.com/ru/post/1698950/More articles:Эквивалентная функция is_file() для URL-адресов? - phpHow is gmail source converted? - htmlBizarre python ImportError - pythonSingleton Data Access Slots - c #Shared hosting - c #How does the Cauchy Reed-Solomon algorithm work? - referenceIt takes a simple RegEx to find the number in one word - regexHow to delete browser cookies using javascript? - javascriptMore Firefox Tools for Checking JavaScript Syntax? - javascriptHow to send an array through an HTTP service in Adobe Flex 3 - httpAll Articles