Showing posts with label DotNet. Show all posts
Showing posts with label DotNet. Show all posts

Wednesday, December 19, 2012

C# Custom Value from DateTimePicker

Custom value from datetimepicker as below:
 
string date = DateTimePicker1.Value.ToString("yyyy-MM-dd");

C# Convert Hex to Decimal and vice versa

Convert Hex to Decimal as below;
 
int DecimalVal = Convert.ToInt32(HexVal, 16);
Convert Decimal to Hex as below;
 
string HexVal = DecimalVal .ToString("X");

C# DateTime Custom String Method

Sample Code as bellow:
DateTime DT = DateTime.ParseExact("20121207015640","yyyyMMddHHmmss",null);  
For more info MSDN DateTime.ParseExact