Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Dangerous dateOfBirth date format recommandation for java applications for the latest dates of the year #40

Open
arisjramos opened this issue Dec 17, 2021 · 0 comments

Comments

@arisjramos
Copy link

arisjramos commented Dec 17, 2021

Hello,

For JAVA application, There is a misleading date format recommendation in the personal-data section of the readme.md for the dateOfBirth field

ref : https://github.com/admin-ch/CovidCertificate-Apidoc#personal-data

it's written :

dateOfBirth: date of birth of the covid certificate owner.
Format: ISO 8601 date without time or YYYY-MM or YYYY

In the JAVA language, YYYY (uppercase) indicates the year of the week. For people born in the latest dates of the year, like 29.12.YYYY or 30.12.YYYY or 31.12.YYYY, there are big chances that the formatting of those dates will fall in a year bigger by 1 that expected, example : 1980-12-30 after format with the YYYY-MM pattern will yield "1981-12".

To avoid this problem, change de recommendation to yyyy (lowercase) that indeed seems universally adopted by all languages to format the year of the date.

for more informations in java format see : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true

Aris Javier Ramos
Hôpitaux Universitaires de Genève

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant