diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
new file mode 100644
index 726a1f4..f4677af
*** a/src/backend/utils/adt/formatting.c
--- b/src/backend/utils/adt/formatting.c
*************** static void dump_node(FormatNode *node, 
*** 964,969 ****
--- 964,970 ----
  
  static char *get_th(char *num, int type);
  static char *str_numth(char *dest, char *num, int type);
+ static int add_era_to_partial_year(int year);
  static int	strspace_len(char *str);
  static int	strdigits_len(char *str);
  static void from_char_set_mode(TmFromChar *tmfc, const FromCharDateMode mode);
*************** is_next_separator(FormatNode *n)
*** 1968,1973 ****
--- 1969,1995 ----
  	return TRUE;				/* some non-digit input (separator) */
  }
  
+ 
+ static int
+ add_era_to_partial_year(int year)
+ {
+ 	/* Force 0-69 into the 2000's */
+ 	if (year < 70)
+ 		return year + 2000;
+ 	/* Force 70-99 into the 1900's */
+ 	else if (year >= 70 && year < 100)
+ 		return year + 1900;
+ 	/* Force 100-499 into the 2000's */
+ 	else if (year >= 100 && year < 500)
+ 		return year + 2000;
+ 	/* Force 500-999 into the 1000's */
+ 	else if (year >= 500 && year < 1000)
+ 		return year + 1000;
+ 	else
+ 		return year;
+ }
+ 
+ 
  static int
  strspace_len(char *str)
  {
*************** DCH_from_char(FormatNode *node, char *in
*** 2931,2972 ****
  			case DCH_YYY:
  			case DCH_IYY:
  				from_char_parse_int(&out->year, &s, n);
  				out->yysz = 3;
- 
- 				/*
- 				 * 3-digit year: '100' ... '999' = 1100 ... 1999 '000' ...
- 				 * '099' = 2000 ... 2099
- 				 */
- 				if (out->year >= 100)
- 					out->year += 1000;
- 				else
- 					out->year += 2000;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_YY:
  			case DCH_IY:
  				from_char_parse_int(&out->year, &s, n);
  				out->yysz = 2;
- 
- 				/*
- 				 * 2-digit year: '00' ... '69'	= 2000 ... 2069 '70' ... '99'
- 				 * = 1970 ... 1999
- 				 */
- 				if (out->year < 70)
- 					out->year += 2000;
- 				else
- 					out->year += 1900;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_Y:
  			case DCH_I:
  				from_char_parse_int(&out->year, &s, n);
  				out->yysz = 1;
- 
- 				/*
- 				 * 1-digit year: always +2000
- 				 */
- 				out->year += 2000;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_RM:
--- 2953,2974 ----
  			case DCH_YYY:
  			case DCH_IYY:
  				from_char_parse_int(&out->year, &s, n);
+ 				out->year = add_era_to_partial_year(out->year);
  				out->yysz = 3;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_YY:
  			case DCH_IY:
  				from_char_parse_int(&out->year, &s, n);
+ 				out->year = add_era_to_partial_year(out->year);
  				out->yysz = 2;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_Y:
  			case DCH_I:
  				from_char_parse_int(&out->year, &s, n);
+ 				out->year = add_era_to_partial_year(out->year);
  				out->yysz = 1;
  				s += SKIP_THth(n->suffix);
  				break;
  			case DCH_RM:
