Monday, 31 March 2014

Check Date formate and convert in datetime using c#

 string dd =lbldt.Text.Substring(0, lbldt.Text.Length - (lbldt.Text.Length - 2));
                    string [] pp = dd.Split('/');
                    if (Convert.ToInt32(pp[0]) < 12)
                    {
                        ldatet = Convert.ToDateTime(lbldt.Text, CultureInfo.InvariantCulture);
                    }
                    else
                    {
                        ldatet = Convert.ToDateTime(lbldt.Text, CultureInfo.CreateSpecificCulture("en-AU").DateTimeFormat);                  
                    }

Convert datetime dd/mm/yyyy to mm/dd/yyyy using c#

 string dt=  DateTime.ParseExact("28/08/2012", "dd/MM/yyyy", CultureInfo.InvariantCulture).ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

//Converting DateTime
Convert.ToDateTime(lbldt.Text, CultureInfo.CreateSpecificCulture("en-AU").DateTimeFormat);

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...