Permalink
Browse files

Fix getDate and getType ( Richard Régul )

  • Loading branch information...
1 parent 73d18cc commit 76cf9dd4c6914c21a419f50d6a79f1288eb1a46e @borisz borisz committed Feb 5, 2010
Showing with 3 additions and 2 deletions.
  1. +1 −0 ChangeLog
  2. +2 −2 DatabaseInfo.cs
View
@@ -1,3 +1,4 @@
+ - Fix getDate and getType ( Richard Régul )
1.12 Aug 18th, 2009
- Sync RegionName.cs with more recent FIPS codes ( 20090723 ). ( Boris Zentner )
- Guard most functions in lookupService by either lock or [MethodImpl(MethodImplOptions.Synchronized)] ( Kfir Harel )
View
@@ -55,7 +55,7 @@ public class DatabaseInfo {
// Get the type code from the database info string and then
// subtract 105 from the value to preserve compatability with
// databases from April 2003 and earlier.
- return Convert.ToInt32(info.Substring(4, 7)) - 105;
+ return Convert.ToInt32(info.Substring(4, 3)) - 105;
}
}
@@ -76,7 +76,7 @@ public class DatabaseInfo {
public DateTime getDate() {
for (int i=0; i<info.Length-9; i++) {
if (Char.IsWhiteSpace(info[i]) == true) {
- String dateString = info.Substring(i+1, i+9);
+ String dateString = info.Substring(i+1, 8);
try {
//synchronized (formatter) {
return DateTime.ParseExact(dateString,"yyyyMMdd",null);

0 comments on commit 76cf9dd

Please sign in to comment.