({{, (RefLink[$DateStringFormat, paclet:ref/$DateStringFormat]) 
gives the default format to use for date strings generated by (RefLink[DateString, paclet:ref/DateString]).}})

OpenersNotesSection(Spacer1)Details

(RefLink[$DateStringFormat, paclet:ref/$DateStringFormat]) can be set to any format specification supported by (RefLink[DateString, paclet:ref/DateString]).

A typical initial default setting is $DateStringFormat="DateTimeShort".

OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Use long date format:

Block[{$DateStringFormat="DateTime"},DateString[]]

Specify your own format:

Block[{$DateStringFormat={"Hour",":","Minute",":","Second"}},DateString[]]

OpenersExampleSection1(Spacer1)Generalizations & Extensions  (1)

Include a time zone:

Block[{$DateStringFormat={"Time"," ","TimeZone"}},DateString[]]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

Use (RefLink[$DateStringFormat, paclet:ref/$DateStringFormat]) to set the default format for date strings within (RefLink[DatePlus, paclet:ref/DatePlus]):

Block[{$DateStringFormat={"Month","/","Day","/","Year"}},DatePlus[DateString[],{4,"Month"}]]

Date string formats match date patterns:

Block[{$DateStringFormat={"Hour",":","Minute"}},DateString[]]

StringMatchQ[%,DatePattern[{"Hour",":","Minute"}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[DateString, paclet:ref/DateString])  ▪  (RefLink[$TimeZone, paclet:ref/$TimeZone])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Date & Time, paclet:guide/DateAndTime])}, {▪(RefLinkPlain[Locale & Internationalization, paclet:guide/LocaleAndInternationalization])}, {▪(RefLinkPlain[Wolfram System Setup, paclet:guide/WolframSystemSetup])}, {▪(RefLinkPlain[Cloud Execution Metadata, paclet:guide/CloudExecutionMetadata])}, {▪(RefLinkPlain[Session Customization, paclet:guide/SessionCustomization])}})}})