HI experts...
I need to change my system date format to "united kingdom" through my program.how to do that? please help me..I am using Access-2003.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lalit MRank #1,186 · 1.5K reputationPosted Mar 7, 2010, 9:20 PM EST
http://www.longhorncorner.com/Forums/ShowMessages.aspx?ThreadID=73042
more details you will get here
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 7, 2010, 9:25 PM EST
You can find dateformat according to united kingdom with the help of System.Globalization.CultureInfo class
System.Globalization.Cultu
string DtFormat = culture.DateTimeFormat.FullDateTimePattern.ToString();
after that you can edit some registry value of following:
HKEY_Users --> S-1-5-21-1390067357-1770027372-682003330-1003 --> Control Panel --> International
Thank you
Lalit MRank #1,186 · 1.5K reputationPosted Mar 7, 2010, 9:42 PM EST
using System; using System.Globalization; using System.Threading; public class DateToStringExample { public static void Main() { CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; DateTime exampleDate = new DateTime(2008, 5, 1, 18, 32, 6); // Display the date using the current (en-US) culture. Console.WriteLine(exampleDate.ToString()); // Change the current culture to fr-FR and display the date. Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR"); Console.WriteLine(exampleDate.ToString()); // Change the current culture to ja-JP and display the date. Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("ja-JP"); Console.WriteLine(exampleDate.ToString()); // Restore the original culture Thread.CurrentThread.CurrentCulture = currentCulture; } } // The example displays the following output to the console: // 5/1/2008 6:32:06 PM // 01/05/2008 18:32:06 // 2008/05/01 18:32:06paul daniel189 reputationPosted Mar 8, 2010, 2:23 AM EST
C#
// we need to have imported System.Globalization
// using System.Globalization;
// fetch the en-GB culture
CultureInfo ukCulture = new CultureInfo("en-GB");
// pass the DateTimeFormat information to DateTime.Parse
DateTime myDateTime = DateTime.Parse("18/09/2004",ukCulture.DateTimeFormat);
VB.NET
' we need to have imported System.Globalization
' Imports System.Globalization
' fetch the en-GB culture
Dim ukCulture As CultureInfo = New CultureInfo("en-GB")
' pass the DateTimeFormat information to DateTime.Parse
Dim myDateTime As DateTime = DateTime.Parse("18/09/2004", ukCulture.DateTimeFormat)
Ankur GuptaRank #1,017 · 1.9K reputationPosted May 26, 2010, 4:31 AM EDT
Imports System.Threading.Thread
...
Dim newCulture As CultureInfo = New CultureInfo(CultureInfo.CurrentCulture.Name)
newCulture.DateTimeFormat.ShortDatePattern = "dd-MMM-yy"
CurrentThread.CurrentCulture = newCulture
MsgBox(CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.ToString)