¡@

Home 

c# Programming Glossary: datetime

How to Query an NTP Server using C#?

http://stackoverflow.com/questions/1193955/how-to-query-an-ntp-server-using-c

Time of the NTP Server returned as either a string or as a DateTime . How is this possibly in its simplest form c# datetime ntp.. answer this question for future reference public static DateTime GetNetworkTime default Windows time server const string ntpServer.. 1000 fractPart 1000 0x100000000L UTC time var networkDateTime new DateTime 1900 1 1 0 0 0 DateTimeKind.Utc .AddMilliseconds..

Why .NET String is immutable? [duplicate]

http://stackoverflow.com/questions/2365272/why-net-string-is-immutable

sense therefore that Christmas.AddMonths 1 produces a new DateTime rather than changing a mutable one. Another example if I as..

How to convert UNIX timestamp to DateTime and vice versa?

http://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa

to convert UNIX timestamp to DateTime and vice versa As the title says really. There is this example.. is what I've got so far public Double CreatedEpoch get DateTime epoch new DateTime 1970 1 1 0 0 0 0 .ToLocalTime TimeSpan span.. so far public Double CreatedEpoch get DateTime epoch new DateTime 1970 1 1 0 0 0 0 .ToLocalTime TimeSpan span this.Created.ToLocalTime..

Proper way to implement IXmlSerializable?

http://stackoverflow.com/questions/279534/proper-way-to-implement-ixmlserializable

MyEvent IXmlSerializable private string _title private DateTime _start private DateTime _stop public XmlSchema GetSchema return.. private string _title private DateTime _start private DateTime _stop public XmlSchema GetSchema return null public void ReadXml.. reader.LocalName MyEvent _title reader Title _start DateTime.FromBinary Int64.Parse reader Start _stop DateTime.FromBinary..

Is DateTime.Now the best way to measure a function's performance?

http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance

DateTime.Now the best way to measure a function's performance I need.. code snippet the best way to measure the performance DateTime startTime DateTime.Now Some execution process DateTime endTime.. the best way to measure the performance DateTime startTime DateTime.Now Some execution process DateTime endTime DateTime.Now TimeSpan..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

MyData public int A get set public string B get set public DateTime C get set public decimal D get set public string E get set public.. new MyData just gibberish... A i B i.ToString C DateTime.Now.AddSeconds i D i E hello F i 2 RunTest foos Vanilla..

How do I calculate someone's age in C#?

http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c

do I calculate someone's age in C# Given a DateTime representing a person's birthday how do I calculate their age.. enough. To me this seems simpler and easier to understand DateTime today DateTime.Today int age today.Year bday.Year if bday today.AddYears.. this seems simpler and easier to understand DateTime today DateTime.Today int age today.Year bday.Year if bday today.AddYears age..

How to get difference between two dates in Year/Month/Week/Day?

http://stackoverflow.com/questions/1083955/how-to-get-difference-between-two-dates-in-year-month-week-day

s month s week s and day s between two dates. c# .net datetime share improve this question This is actually quite tricky...

What does “DateTime?” mean in C#?

http://stackoverflow.com/questions/109859/what-does-datetime-mean-in-c

DateTime startdate What does DateTime mean c# .net datetime syntax nullable share improve this question Since DateTime..

Given a DateTime object, how do I get a ISO 8601 date in string format?

http://stackoverflow.com/questions/114983/given-a-datetime-object-how-do-i-get-a-iso-8601-date-in-string-format

format I am looking for is yyyy MM ddTHH mm ssZ c# datetime datetime format iso8601 share improve this question DateTime.UtcNow.ToString.. I am looking for is yyyy MM ddTHH mm ssZ c# datetime datetime format iso8601 share improve this question DateTime.UtcNow.ToString..

How to Query an NTP Server using C#?

http://stackoverflow.com/questions/1193955/how-to-query-an-ntp-server-using-c

a DateTime . How is this possibly in its simplest form c# datetime ntp share improve this question Since the old accepted answer..

Calculate the number of business days between two dates?

http://stackoverflow.com/questions/1617049/calculate-the-number-of-business-days-between-two-dates

of business or weekdays days between two dates Thanks c# datetime share improve this question I've had such a task before..

C# - Convert UTC/GMT time to local time

http://stackoverflow.com/questions/179940/c-sharp-convert-utc-gmt-time-to-local-time

or is this some kind of setting on the PC's c# .net datetime utc share improve this question For strings such as 2012..

C# DateTime.Now precision

http://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision

0 stopwatch.ElapsedMilliseconds Console.ReadLine c# .net datetime precision time precision share improve this question Why..

Parse DateTime with timezone of form PST/CEST/UTC/etc

http://stackoverflow.com/questions/241789/parse-datetime-with-timezone-of-form-pst-cest-utc-etc

PST CEST UTC etc I'm trying to parse an international datetime string similar to 24 okt 08 21 09 06 CEST So far I've got something.. for parsing timezones in PST CEST GMT UTC form. c# .net datetime parsing internationalization share improve this question ..

Creating a DateTime in a specific Time Zone in c# fx 3.5

http://stackoverflow.com/questions/246498/creating-a-datetime-in-a-specific-time-zone-in-c-sharp-fx-3-5

a DateTime with a specific timezone like PST c# .net datetime share improve this question Jon's answer talks about TimeZone..

How to convert UNIX timestamp to DateTime and vice versa?

http://stackoverflow.com/questions/249760/how-to-convert-unix-timestamp-to-datetime-and-vice-versa

.ToLocalTime this.Created epoch.AddSeconds value c# unix datetime timestamp share improve this question Here's what you need..

Is DateTime.Now the best way to measure a function's performance?

http://stackoverflow.com/questions/28637/is-datetime-now-the-best-way-to-measure-a-functions-performance

endTime.Subtract startTime c# .net performance datetime timer share improve this question No it's not. Use the Stopwatch..

Stopwatch vs. using System.DateTime.Now for timing events [duplicate]

http://stackoverflow.com/questions/2923283/stopwatch-vs-using-system-datetime-now-for-timing-events

a percent. I get about a 15 20 difference. c# performance datetime timing stopwatch share improve this question As per MSDN.. questions 243351 environment tickcount vs datetime now http stackoverflow.com questions 28637 is datetime now the.. vs datetime now http stackoverflow.com questions 28637 is datetime now the best way to measure a functions performance DateTime..

How can I get the DateTime for the start of the week?

http://stackoverflow.com/questions/38039/how-can-i-get-the-datetime-for-the-start-of-the-week

in C# Something like DateTime.Now.StartWeek Monday c# datetime share improve this question Using an extension method. They're..

DateTime vs DateTimeOffset

http://stackoverflow.com/questions/4331189/datetime-vs-datetimeoffset

DateTimeOffset vs what we have already been doing c# .net datetime timezone datetimeoffset share improve this question DateTimeOffset.. what we have already been doing c# .net datetime timezone datetimeoffset share improve this question DateTimeOffset is a representation..

Parse C# string to DateTime

http://stackoverflow.com/questions/7580809/parse-c-sharp-string-to-datetime

format to do the same without substring c# .net string datetime format share improve this question Absolutely. Guessing..

How do I calculate someone's age in C#?

http://stackoverflow.com/questions/9/how-do-i-calculate-someones-age-in-c

a person's birthday how do I calculate their age c# .net datetime share improve this question For some reason Jeff's code didn't..

Converting String to DateTime C#.net

http://stackoverflow.com/questions/919244/converting-string-to-datetime-c-net

you convert a string suchas 2009 05 08 14 40 52 531 into a datetime c# datetime share improve this question Since you are handling.. string suchas 2009 05 08 14 40 52 531 into a datetime c# datetime share improve this question Since you are handling 24 hour..

How to truncate milliseconds off of a .NET DateTime

http://stackoverflow.com/questions/1004698/how-to-truncate-milliseconds-off-of-a-net-datetime

the Kind property Local Utc or Undefined . DateTime dateTime ... anything ... dateTime new DateTime dateTime.Ticks dateTime.Ticks.. Utc or Undefined . DateTime dateTime ... anything ... dateTime new DateTime dateTime.Ticks dateTime.Ticks TimeSpan.TicksPerSecond.. . DateTime dateTime ... anything ... dateTime new DateTime dateTime.Ticks dateTime.Ticks TimeSpan.TicksPerSecond dateTime.Kind or..

Convert string to DateTime in c#

http://stackoverflow.com/questions/1592653/convert-string-to-datetime-in-c-sharp

easiest way to convert the following date created using dateTime.ToString yyyyMMddHHmmss CultureInfo.InvariantCulture into a.. use the DateTime.TryParseExact method like this DateTime dateTime DateTime.TryParseExact str yyyyMMddHHmmss CultureInfo.InvariantCulture..

Creating a DateTime in a specific Time Zone in c# fx 3.5

http://stackoverflow.com/questions/246498/creating-a-datetime-in-a-specific-time-zone-in-c-sharp-fx-3-5

TimeZoneInfo timeZone public DateTimeWithZone DateTime dateTime TimeZoneInfo timeZone utcDateTime TimeZoneInfo.ConvertTimeToUtc.. timeZone utcDateTime TimeZoneInfo.ConvertTimeToUtc dateTime timeZone this.timeZone timeZone public DateTime UniversalTime..

how to detect if a property exists on a dynamic object in C#?

http://stackoverflow.com/questions/2839598/how-to-detect-if-a-property-exists-on-a-dynamic-object-in-c

Format a date in XML via XSLT

http://stackoverflow.com/questions/500915/format-a-date-in-xml-via-xslt

you can use xsl template name formatDate xsl param name dateTime xsl variable name date select substring before dateTime 'T'.. dateTime xsl variable name date select substring before dateTime 'T' xsl variable name year select substring before date ' '.. xsl template xsl template name formatTime xsl param name dateTime xsl value of select substring after dateTime 'T' xsl template..

How to get the MonthName in c#?

http://stackoverflow.com/questions/975531/how-to-get-the-monthname-in-c

public static string ToMonthName this DateTime dateTime return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName.. CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName dateTime.Month public static string ToShortMonthName this DateTime dateTime.. public static string ToShortMonthName this DateTime dateTime return CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName..