-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved comment for DateOnly. #191
base: develop
Are you sure you want to change the base?
Conversation
As this comment appears in the generated documentation, I would prefer to keep it short (I find it already too long, btw). |
Since the date has no time zone according to the specification, no exact time can be defined with it. I think this is a very important piece of information. We should mention this, similar to https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html: |
Per definition, a date in the format yyyy-mm-dd does not contain hours nor timezone information. I don't see the need to repeat it in prosa. |
A date is assumed to start at midnight. But when is midnight when you don't know the time zone? |
If you want to refer to a point in time, you use date-time which is millisecond accurate and timezone dependent. |
If I have an entity with a validity from 1.1.2022 to 31.1.2022 in CET, I will always use datatype DateTime. Even if I do not use the time information. With the data type DateOnly, I cannot create a java.sql.Date in Java until I know a time zone. |
If you want to map to a java.util.Date, then you need a timezone information yes. By definition, with a date it is the local timezone. |
If I run my application in the cloud, then the local time zone is UTC, but on my notebook it is CET. Generally, from a technical point of view, I prefer UTC, but the business partly demands CET. How can I distinguish what applies? |
No description provided.