Converting the specified string representation of a date and time to its DateTime equivalent

Tharif

Rephrasing the question found at SO.

Code 1 :

DateTime.TryParse("5-5-5-5" , CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal  , out result);

Code 2:

DateTime.TryParse("5-5-5-5.00" , CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal  , out result);

When the format is changed to 5-5-5-5.00 entire result changes ,Why does that happen ?Does that depend on Culture properties ?

Henrik Bøgelund Lavstsen

Do like in this answer

But they tell system what the string is: "5-5-5-5" is a horrible string format for a date. The format string would proberbly be: "d-M-y-h" in your case unless i misunderstand

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Converting the specified string representation of a date and time to its DateTime equivalent

From Dev

Converting a date to string representation

From Dev

Converting Sitecore nvarchar date representation to SQL datetime

From Dev

DateTime conversion failed when converting date and/or time from character string

From Dev

Converting string to date time

From Dev

converting string representation of unknown date-format to Date in java

From Dev

Converting time string into Date object

From Dev

Converting string to date time by parsing

From Dev

converting long date to date time format for my specified date

From Dev

Converting Date field and Character Time field to DateTime

From Dev

Converting DateTime to EPOCH time is returning a new Date

From Dev

datetime conversion failed when converting date or time from character string SQL (c#)

From Dev

Converting a string to to date using Python and datetime

From Dev

Converting a time string to append with DateTime object

From Dev

Converting unicode string of time into datetime object

From Dev

Converting a time string to append with DateTime object

From Dev

Converting unicode string of time into datetime object

From Dev

Converting a hex string to its BigInteger equivalent negates the value

From Dev

Converting date and time from String format to Python datetime object: ValueError: time data '... p.m.' does not match format '... %p'

From Dev

DateTime String to Date, In Time and Out Time

From Dev

converting php string with date and time to sql timestamp

From Dev

Converting string to date object without time info

From Dev

Converting audio file time to string and to date

From Dev

Converting String to Time without Date in Java

From Dev

Python converting date/time string with a timezone offset

From Dev

Create DateTime from date string and time string

From Dev

Jackson automatically converting json date to 8 hours ahead of its time

From Dev

Converting a non standard date string to a mysql datetime string using php

From Dev

Issue when converting date and time different variables into dateTime variable

Related Related

  1. 1

    Converting the specified string representation of a date and time to its DateTime equivalent

  2. 2

    Converting a date to string representation

  3. 3

    Converting Sitecore nvarchar date representation to SQL datetime

  4. 4

    DateTime conversion failed when converting date and/or time from character string

  5. 5

    Converting string to date time

  6. 6

    converting string representation of unknown date-format to Date in java

  7. 7

    Converting time string into Date object

  8. 8

    Converting string to date time by parsing

  9. 9

    converting long date to date time format for my specified date

  10. 10

    Converting Date field and Character Time field to DateTime

  11. 11

    Converting DateTime to EPOCH time is returning a new Date

  12. 12

    datetime conversion failed when converting date or time from character string SQL (c#)

  13. 13

    Converting a string to to date using Python and datetime

  14. 14

    Converting a time string to append with DateTime object

  15. 15

    Converting unicode string of time into datetime object

  16. 16

    Converting a time string to append with DateTime object

  17. 17

    Converting unicode string of time into datetime object

  18. 18

    Converting a hex string to its BigInteger equivalent negates the value

  19. 19

    Converting date and time from String format to Python datetime object: ValueError: time data '... p.m.' does not match format '... %p'

  20. 20

    DateTime String to Date, In Time and Out Time

  21. 21

    converting php string with date and time to sql timestamp

  22. 22

    Converting string to date object without time info

  23. 23

    Converting audio file time to string and to date

  24. 24

    Converting String to Time without Date in Java

  25. 25

    Python converting date/time string with a timezone offset

  26. 26

    Create DateTime from date string and time string

  27. 27

    Jackson automatically converting json date to 8 hours ahead of its time

  28. 28

    Converting a non standard date string to a mysql datetime string using php

  29. 29

    Issue when converting date and time different variables into dateTime variable

HotTag

Archive