Reputation: 8941
How does .NET determine where I am? How can I manipulate my current location and thus the behavior of this method?
The reason is I'm using .NET MF on a microcontroller board. Here I don't have any operating system. Still I want to convert times to my local time.
Upvotes: 1
Views: 413
Reputation: 26209
Try This:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");//culture name
Upvotes: 1
Reputation: 3915
There are basically two ways, you either set the CurrentCulture for your whole instance
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); //For German
or you can just use it to format your outputs like:
DateTime dt = DateTime.Now;
Console.WriteLine(dt.ToString("d",new CultureInfo("de-DE"))); //For German
Upvotes: 1