Author: newasp.netdevelopor | Posted on: 9/23/2008 1:03:07 PM | Views : 1600

Presently we are using following .NET convert class for DateTime.
But now we need to use localized resources. ToShortDateString() uses the current thread?s culture information.

I think we can change the thread?s culture
to the country?s culture(by passing the current country code) before the ToShortDate call, then switch it back to the
original culture before exiting. 
But I am not sure how to do this. Would appreciate any help with the code.

public static string ToString(DateTime value, string format) //format is for ex: MM/DD/YYYY
        {            
            return value.(format, System.Globalization.CultureInfo.CurrentCulture);
        }
 

 Thanks!
...

Go to the complete details ...