RR , YY and YYYY will interpret variable length years

 

RR, YY and YYYY masks will interpret variable length years, means you can specify both two-digit or four-digit format as shown below, and it will work. They all produce the same result

It worth to remember, because you may expect similar situation on the exam where the mask is RR or YY, but the year value that needs to be converted through to_date() function has four digits. Or otherwise, the value that needs to be converted will be shown as two digits, while the mask will have four digits. All these combinations are valid, despite the first impression you may have.

Leave a comment

Your email address will not be published. Required fields are marked *