Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > system clender time and date
 

system clender time and date

sir
i have problem with datetime

if user change datatime from control panel ,all my application is closed
i want ,when my application start ,automaticaly current system datatime or clender to be change to english

forexample
when application start i write the for
change current input language

just like

code

dim arabic as inputlanguage

 

For i = 0 To InputLanguage.InstalledInputLanguages.Count - 1

 

If InputLanguage.InstalledInputLanguages(i).Culture.TwoLetterISOLanguageName.ToString = "ar" Then

ArabicInput = InputLanguage.InstalledInputLanguages(i)

 

ElseIf InputLanguage.InstalledInputLanguages(i).Culture.TwoLetterISOLanguageName.ToString = "en" Then

EnglishInput = InputLanguage.InstalledInputLanguages(i)

 

End If

 

Next



inputlanguage.defaultinputlanguage=arabic

i also want such like for change system clender and time

please consider iwant to change system clender and time to english

thanks
M.saqib  Tuesday, October 06, 2009 8:41 AM
Dear M.Saqib,

Use the following code to set application date and time at app start up method.

 // Creating a Global Culture specific to our application.
                System.Globalization.CultureInfo cultureInfo =
                    new System.Globalization.CultureInfo("en-US");
                // Creating the DateTime Information specific to our application.
                System.Globalization.DateTimeFormatInfo dateTimeInfo =
                    new System.Globalization.DateTimeFormatInfo();
                // Defining various date and time formats.
                dateTimeInfo.DateSeparator = "/";
                dateTimeInfo.LongDatePattern = "dd/MMM/yyyy";
                dateTimeInfo.ShortDatePattern = "dd/MMM/yy";
                dateTimeInfo.LongTimePattern = "hh:mm:ss tt";
                dateTimeInfo.ShortTimePattern = "hh:mm:tt";
                // Setting application wide date time format.
                cultureInfo.DateTimeFormat = dateTimeInfo;
                // Assigning our custom Culture to the application current thread. 
                Application.CurrentCulture = cultureInfo;
                Thread.CurrentThread.CurrentCulture = cultureInfo;
                Thread.CurrentThread.CurrentUICulture = cultureInfo;
                //End Culture Info
It will help to resolve you issue .
  • Marked As Answer byM.saqib 15 hours 28 minutes ago
  •  
Malik M.Shahid  Wednesday, October 07, 2009 8:44 AM
Dear M.Saqib,

Use the following code to set application date and time at app start up method.

 // Creating a Global Culture specific to our application.
                System.Globalization.CultureInfo cultureInfo =
                    new System.Globalization.CultureInfo("en-US");
                // Creating the DateTime Information specific to our application.
                System.Globalization.DateTimeFormatInfo dateTimeInfo =
                    new System.Globalization.DateTimeFormatInfo();
                // Defining various date and time formats.
                dateTimeInfo.DateSeparator = "/";
                dateTimeInfo.LongDatePattern = "dd/MMM/yyyy";
                dateTimeInfo.ShortDatePattern = "dd/MMM/yy";
                dateTimeInfo.LongTimePattern = "hh:mm:ss tt";
                dateTimeInfo.ShortTimePattern = "hh:mm:tt";
                // Setting application wide date time format.
                cultureInfo.DateTimeFormat = dateTimeInfo;
                // Assigning our custom Culture to the application current thread. 
                Application.CurrentCulture = cultureInfo;
                Thread.CurrentThread.CurrentCulture = cultureInfo;
                Thread.CurrentThread.CurrentUICulture = cultureInfo;
                //End Culture Info
It will help to resolve you issue .
  • Marked As Answer byM.saqib 15 hours 28 minutes ago
  •  
Malik M.Shahid  Wednesday, October 07, 2009 8:44 AM
thanks
    
   actually i change just in my application

    My.Application.ChangeCulture("ar-AE")
or 
    My.Application.ChangeCulture("en-us")

is this correct ?

i have seen  some time 

when format datatime , format such like 

format(datatime value,system.globalization.cultureinfo("en-us")) ( may be such like)

can you explain




  • Edited byM.saqib 15 hours 16 minutes agoadd
  •  
M.saqib  15 hours 19 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• ERROR INSTALLING TERRARIUM CLIENT...
• Not so smooth re-introduction of Terrarium
• Unable to use GetCurrentWebBrowser
• TaskVision 2.0
• about Icons of XPander
• Multi-dataset vs. multi-table
• Install Task Vision Server in a Domain
• How it is done?
• Terrarium Servers Down For Maintenance
• IssueVision Documentation