Skip to content
This repository was 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

@arisjramos

Description

@arisjramos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions