c# - Finding out the DateTimeFormat obtained when DateTime.ToString( ) is called -
I have the following problem with handling datetime formats for the development of a component.
string value = date. Now.ToString (); // value = "8/3/2010 2:20:49 PM"
How do I find that the date format refers to value
-> I want to store this current datetime format during export and use the same during import. Many APIs available in DateTimeFormatInfo.CurrentInfo
and Culture IFFO.SharraCulture.DatimFormat
do not provide this information.
I know that using a solution DT is to use. Toasting ("You") to store and parse the universal format in daytime, but I'm curious how I can get the format above.
To copy the documentation:
DateTime TowString ()
The value of this example is formatted using normal form specifier, 'g', as described in the formatting overview topic. The return value is the same as the value given by
ToString ("G", null)
. Overview of document links -> Date and time format string
G
Normal date / time pattern (long time)
Displays a combination of short dates
The format you want should be obtained with a combination of
ShortDatePattern
andLongTimePattern
membersthreads.ContentTrad.CurrentCulture. Detamemate
.
Comments
Post a Comment