CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of DateTime
C#
//using System.Globalization;
CultureInfo culture = new CultureInfo("en-AU");
DateTime week_start = Convert.ToDateTime("27/07/2011", culture);
by Egli   August 01, 2011 @ 12:27am
98 Views
no comments
 
C#
// create date time 2008-03-09 16:05:07.123
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);
 
String.Format("{0:y yy yyy yyyy}", dt);  // "8 08 008 2008"   year
String.Format("{0:M MM MMM MMMM}", dt);  // "3 03 Mar March"  month
String.Format("{0:d dd ddd dddd}", dt);  // "9 09 Sun Sunday" day
String.Format("{0:h hh H HH}",     dt);  // "4 04 16 16"      hour 12/24
String.Format("{0:m mm}",          dt);  // "5 05"            minute
String.Format("{0:s ss}",          dt);  // "7 07"            second
String.Format("{0:f ff fff ffff}", dt);  // "1 12 123 1230"   sec.fraction
by Egli   July 24, 2011 @ 10:54pm
69 Views
no comments
 
C#
public DateTime getIndianStandardTime()
{
 TimeZoneInfo IND_ZONE=TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
 return TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, IND_ZONE);
}
by pandiyachendur   July 16, 2010 @ 2:17am
240 Views
no comments
 
SQL
'1/1/2000 1:30 AM' != '1/1/2000 1:31 AM'
 
-- ///
 
DECLARE @x datetime
SET @x = GETDATE()
SET @x = CONVERT(varchar, @x, 101)
 
-- ///
by Jerry Nixon   March 05, 2010 @ 8:53am
Tags: SQL, DateTime
466 Views
no comments
 
C#
// create date time 2008-03-09 16:05:07.123
DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123);
 
String.Format("{0:y yy yyy yyyy}", dt);  // "8 08 008 2008"   year
String.Format("{0:M MM MMM MMMM}", dt);  // "3 03 Mar March"  month
String.Format("{0:d dd ddd dddd}", dt);  // "9 09 Sun Sunday" day
String.Format("{0:h hh H HH}",     dt);  // "4 04 16 16"      hour 12/24
String.Format("{0:m mm}",          dt);  // "5 05"            minute
String.Format("{0:s ss}",          dt);  // "7 07"            second
String.Format("{0:f ff fff ffff}", dt);  // "1 12 123 1230"   sec.fraction
by KMS   December 23, 2009 @ 9:17am
Tags: DateTime
412 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate