Format:
Recent snippets matching tags of date
//using System.Globalization; CultureInfo culture = new CultureInfo("en-AU"); DateTime week_start = Convert.ToDateTime("27/07/2011", culture);
98 Views
no comments
// 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
69 Views
no comments
/*
WRITE A PROGRAM TO CALCULATE NUMBERS OF DAYS BETWEEN 1 JAN 1900 AND USER ENTERED DATE.
NOTE: 1900 was not leap year, after that every 4 year there is leap year 1904,1908, 1912 ...) upto 2096 .
now again 3000 is not leap year and so on after 3000 (3004, 3008, 30012 ) is leap year .
u can calulate that .
in case u know about leap year.
http://kalender-365.de/leap-years.php
95 Views
no comments
function checkEmail(inputvalue){ var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; if(pattern.test(inputvalue)){ return true; }else{ return false; } }
172 Views
no comments
Object:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:MM/dd/yyyy}")]
View:
<%= Html.EditorFor(model => model.suspension.DateBegin)%>
196 Views
no comments
public DateTime getIndianStandardTime() { TimeZoneInfo IND_ZONE=TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"); return TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, IND_ZONE); }
240 Views
no comments
public static IEnumerable<ValidationResult> Validate(object component) { return from descriptor in TypeDescriptor.GetProperties(component).Cast<PropertyDescriptor>() from validation in descriptor.Attributes.OfType<System.ComponentModel.DataAnnotations.ValidationAttribute>() where !validation.IsValid(descriptor.GetValue(component)) select new ValidationResult( validation.ErrorMessage ?? string.Format(CultureInfo.CurrentUICulture, "{0} validation failed.", validation.GetType().Name), new[] { descriptor.Name }); }
233 Views
no comments
NSData *soundData = [NSData dataWithContentsOfURL:url]; AVAudioPlayer *avPlayer = [[AVAudioPlayer alloc] initWithData:soundData error: nil]; [avPlayer play];
479 Views
no comments
LPARAMETERS cfile, olog LOCAL citems, cparts, citem, cpart, citemprev, calias, cfilen, cfilennew, nrec, nrecd, nafld, nprevsel, lcsubject, lcbody, lcbodyitems, lcbodyparts ccr= CHR(13)+CHR(10) nprevsel = SELECT() cfile = LOWER(cfile) sns = ALLTRIM(SYS(2))
199 Views
no comments
<Extension()> _ Public Function TimeIntervals(ByVal DateNavigator As DateNavigator) As TimeIntervalCollection Dim dc As List(Of DateTime) = (From x In DateNavigator.Selection Order By CDate(x) Select CDate(x)).ToList TimeIntervals = New TimeIntervalCollection Dim startdt As DateTime = DateTime.MinValue, enddt As DateTime = DateTime.MinValue For Each dt As DateTime In dc If startdt = DateTime.MinValue Then startdt = dt If enddt > DateTime.MinValue _ AndAlso enddt.AddDays(1) < dt Then TimeIntervals.Add(New TimeInterval(startdt, enddt.Subtract(startdt)))
354 Views
no comments
/// <reference path="jquery.js" /> /* ServiceProxy.js Version 0.981 - 4/5/11 (c) 2008-2011 Rick Strahl, West Wind Technologies www.west-wind.com Load json2.js before this library http://github.com/douglascrockford/JSON-js/blob/master/json2.js
3763 Views
no comments
//UpdatePanel BusyIndicator // gif: http://www.ajaxload.info // html: <span id="busyIndicator" class="floatRight"></span> // #busyIndicator {width:16px; height:16px;} // .busy {background:transparent url(../Images/ajax-loader.gif) no-repeat scroll left top;} var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(InitializeRequest); prm.add_endRequest(EndRequest);
294 Views
no comments
'1/1/2000 1:30 AM' != '1/1/2000 1:31 AM' -- /// DECLARE @x datetime SET @x = GETDATE() SET @x = CONVERT(varchar, @x, 101) -- ///
466 Views
no comments
SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) select convert(varchar(10),getdate(),121) CONVERT(VARCHAR,start_dttm,111)
254 Views
no comments
// 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
412 Views
no comments
System.Threading.Thread.CurrentThread.CurrentCulture = new FarsiLibrary.Utils.PersianCultureInfo(); System.Threading.Thread.CurrentThread.CurrentUICulture = new FarsiLibrary.Utils.PersianCultureInfo(); fXDatePicker1.FlowDirection = FlowDirection.RightToLeft;
574 Views
1 comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
