Declare string constants for date formats instead of explicitly having to write string values
<p>Is it advisable / good programming practice to store date formats as string constants which can then be used throughout a web application?</p>

<p>For instance, instead of writing <code>.ToString("dd.MM.yyyy")</code> in code-behind, one would use <code>.ToString(MyDateClass.DateFormat1)</code>. If <code>.ToString("yyyy.MM.dd")</code> is used elsewhere, we would create MyDateClass.DateFormat2 and use <code>.ToString(MyDateClass.DateFormat2)</code>.</p>

<p>For JS code one could for instance have global string variables for <code>"dd.MM.yyyy"</code> and <code>"yyyy.MM.dd"</code> and these will be used instead.</p>