I have a function that checks to see if a string passed is a date with the string "4AD2182"
DateTime.Parse("4AD2182") returns the following Result:
{4/1/2182 12:00:00 AM}
Date: {4/1/2182 12:00:00 AM}
Day: 1
DayOfWeek: Monday
DayOfYear: 91
Hour: 0
Kind: Unspecified
Millisecond: 0
Minute: 0
Month: 4
Second: 0
Ticks: 688334976000000000
TimeOfDay: {00:00:00}
Year: 2182
Is this a bug?
Thanks!
####### Code #########
public
{
{
}
{
}
}
return false;#############################3
VulpesPosted Aug 25, 2011, 6:11 PM
So:
DateTime dt = new DateTime(2182, 4, 1);
string s = dt.ToString("Mgyyyy"); // 4A.D.2182
Parsing with dots after the A and D also works but it's certainly a strange one :)