Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 13 lut 2009 · Try using a culture info which matches the DateTime format for your string values: DateTime dt = Convert.ToDateTime(one + " " + two, CultureInfo.GetCultureInfo("ro-RO")); or modify the input string so that the hour has 2 digits:

  2. 28 maj 2009 · Let's say you have a date with format yyMMdd. The fastest way to convert it that I found is: var d = new DateTime((s[0] - '0') * 10 + s[1] - '0' + 2000, (s[2] - '0') * 10 + s[3] - '0', (s[4] - '0') * 10 + s[5] - '0') Just, choose the indexes according to your date format of choice.

  3. 4 paź 2022 · The DateTime.ParseExact method converts a string to a DateTime object if it conforms to one of the specified string patterns. When a string that isn't one of the forms specified is passed to this method, a FormatException is thrown.

  4. 11 mar 2024 · The DateTime.ParseExact() method converts the specified string representation of a date and time to its DateTime equivalent. The format of the string representation must match a specified format exactly.

  5. 13 maj 2021 · You can convert a string to a DateTime (parse) with one of these methods: DateTime.Parse() (or TryParse). Use this to parse a variety of standard formats (culture-specific or ISO-8601) DateTime.ParseExact() (or TryParseExact). Use this to parse from a specific format. I’ll show examples of using both methods for parsing various DateTime formats.

  6. 30 cze 2023 · In this article, we will discuss how to parse string representations of date and time to an equivalent DateTime value in C#. The available methods in the DateTime class include Parse(), TryParse(), ParseExact()and TryParseExact(). These methods can parse a string to a DateTime object differently.

  7. 6 kwi 2024 · Convert a String to a DateTime in C#. This post will discuss how to convert the specified string representation of a date and time format to its DateTime equivalent in C#. 1. Using DateTime.Parse() method. To convert a string representation of a date and time to the DateTime object, use the DateTime.Parse () method.

  1. Ludzie szukają również