Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

Difference between the YY and RR format strings

Difference between the YY and RR format strings

The transformation language also provides a YY format string. Both the RR and YY format strings specify two-digit years. The YY and RR format strings produce identical results when used with all date functions except TO_DATE.
In TO_DATE expressions, RR and YY produce different results.
The following table shows the different results each format string returns:
String
Current year
TO_DATE(String, ‘MM/DD/RR’)
TO_DATE(String, ‘MM/DD/YY’)
04/12/98
1998
04/12/1998 00:00:00
04/12/1998 00:00:00
11/09/01
1998
11/09/2001 00:00:00
11/09/1901 00:00:00
04/12/98
2003
04/12/1998 00:00:00
04/12/2098 00:00:00
11/09/01
2003
11/09/2001 00:00:00
11/09/2001 00:00:00
For dates in the year 2000 and beyond, the YY format string produces less meaningful results than the RR format string. Use the RR format string for dates in the twenty-first century.

0 COMMENTS

We’d like to hear from you!