J
Jack Wright
Dear All,
Behavior of Convert.ToDateTime(string) function:
If the string to be converted to DateTime is like this:
01.09.29, Convert.ToDateTime(string) function returns DateTime as
01.09.2029.
But if try with 01.09.30, then Convert.ToDateTime(string) function
returns DateTime as 01.09.1930
So if the string has two digit year less than 30, while converting
year, it just adds 2000 in that year,
i.e. Resulting Year = 'Two Digit Year' + 2000
But if two digit year >= 30, then
Resulting year = 'Two Digit Year' + 1900
It happens irrespective of my m/c date. Is this behaviour right?
Thanx & Regards
Jack
Behavior of Convert.ToDateTime(string) function:
If the string to be converted to DateTime is like this:
01.09.29, Convert.ToDateTime(string) function returns DateTime as
01.09.2029.
But if try with 01.09.30, then Convert.ToDateTime(string) function
returns DateTime as 01.09.1930
So if the string has two digit year less than 30, while converting
year, it just adds 2000 in that year,
i.e. Resulting Year = 'Two Digit Year' + 2000
But if two digit year >= 30, then
Resulting year = 'Two Digit Year' + 1900
It happens irrespective of my m/c date. Is this behaviour right?
Thanx & Regards
Jack