In the process of globalizing your .NET application, you may notice a number of aspects that are handled differently compared to building an application that is devoid of globalization, including how dates are represented and how currencies are shown. This section looks at some of these issues.
Different cultures specify dates and time very differently. Consider the following date as an example:
Is this date August 11, 2008, or is it November 8, 2008? It should be the job of the business logic layer or the presentation layer to convert all date and times for use by the end user. To avoid interpretation errors, always use the same culture (or invariant culture) when storing values, such as dates and times, in a database or other data store.
Setting the culture at the server level in ASP.NET or within a Windows Forms application, as shown in the earlier examples, enables your .NET application to make these conversions for you. You can also simply assign a new culture to the thread in which the code is running. Close out the ASP.NET solution you were looking at in the preceding section and return to the ProVB2012_Localization project. Now consider the following code, which can be called from the Button_Click_1 event handler. Note that this Sub is dependent on the Imports statements (code file: MainWindow .xaml.vb):
Imports System.Globalization Imports System.Threading Private Sub DisplayCalendarByCulture() ...