.net - Preferred method for handling Y2K date conversions? -
Is there a preferred algorithm for converting a 2-digit year into a 4-digit year?
I have a 2-digit birth date (with month and day) that I want to convert to a C #
constant int GetFourDigitYear (int year, int maxyear) {System.Globalization.GregorianCalendar cal = New system.Globalization.Gregorian calendar (); Cal.TwoDigitYearMax = maxyear; Return callout Force degree (year); }
Max-Year
should be the current four digit year.
Edit : OP Solution:
Static GetFourDigitYear (int year, int pivot) {System.Globalization.GregorianCalendar cal = New System.Globalization.GregorianCalendar (); Cal.TwoDigitYearMax = New DateTime Year + (100-fog); Return callout Force degree (year); }
Comments
Post a Comment