Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. If your string format for the DateTime is fixed you can convert to the System.DateTime using: string myDate = "12-Apr-1976 22:10"; DateTime dateValue = DateTime.Parse(myDate); Now, when you need it in your specific format, you can then reverse the process, i.e.: string formatForMySql = dateValue.ToString("yyyy-MM-dd HH:mm"); edit - updated code.

  2. 21 mar 2011 · DateTime.Parse() will try figure out the format of the given date, and it usually does a good job. If you can guarantee dates will always be in a given format then you can use ParseExact(): string s = "2011-03-21 13:26"; DateTime dt = DateTime.ParseExact(s, "yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture);

  3. Restore (round-trip) a date and time value created by a formatting operation. Pass the "o" or "r" standard format string to the ToString (String) method, and call the Parse (String, IFormatProvider, DateTimeStyles) overload with DateTimeStyles.RoundtripKind.

  4. 7 kwi 2023 · SQL date strings can be handed with DateTime.Parse. This is useful when you have database text-only data. DateTime.Parse works on the date time format in the MySQL database.

  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. 11 kwi 2015 · Solution 1. If you're having 00-00-0000 date value stored, (Which is special zero value [^]; or you can say DateTime's NULL value), then you should know that .NET framework's DateTime object has a limitation over the DateTime value too, this might be the reason for your errors.

  7. Converts the specified string representation of a date and time to its DateTimeequivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly or an exception is thrown.

  1. Ludzie szukają również