Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jarosmpost
Copy link

No description provided.

@lbovet
Copy link
Member

lbovet commented Feb 9, 2022

As this comment appears in the generated documentation, I would prefer to keep it short (I find it already too long, btw).
Also, the additional text does not really add information because the example date is already giving the same information.

@jarosmpost
Copy link
Author

As this comment appears in the generated documentation, I would prefer to keep it short (I find it already too long, btw). Also, the additional text does not really add information because the example date is already giving the same information.

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:
'This class does not store or represent a time or time-zone. Instead, it is a description of the date, as used for birthdays. It cannot represent an instant on the time-line without additional information such as an offset or time-zone.'

@lbovet
Copy link
Member

lbovet commented Feb 9, 2022

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.

@jarosmpost
Copy link
Author

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?

@lbovet
Copy link
Member

lbovet commented Feb 9, 2022

If you want to refer to a point in time, you use date-time which is millisecond accurate and timezone dependent.
When you refer to a day, you use a yyyy-mm-dd date.

@jarosmpost
Copy link
Author

If you want to refer to a point in time, you use date-time which is millisecond accurate and timezone dependent. When you refer to a day, you use a yyyy-mm-dd date.

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.

@lbovet
Copy link
Member

lbovet commented Feb 9, 2022

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.

@jarosmpost
Copy link
Author

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?

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

Successfully merging this pull request may close these issues.

3 participants