Sujet : Re: Simple Pascal question
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 08. Aug 2024, 01:11:21
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <66b40d29$0$715$14726298@news.sunsite.dk>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 8/7/2024 5:35 PM, Lawrence D'Oliveiro wrote:
Dates/times? You have to contend with an API that has accumulated so much
legacy cruft, that you are left with an old class where every single
member is deprecated, yet the class itself is still needed in the newer-
style calls.
That is also one of Roland's pet peeves.
But it should not be that hard.
There are 3 generations of time API in Java:
* java.util.Date (Java 1.0)
* java.util.Date + java.util.*Calendar + java.text.*DateFormat
(Java 1.1 - 1.7)
* java.util.time.* (Java 1.8-)
But if we look at the second, then the trick is to realize
the mapping of functionality.
java.util.Date ~ C time_t type and time function
java.util.Calendar/GregorianCalendar ~ C mktime/gmtime/localtime
java.text.DateFormat/SimpleDateFormat ~ C strftime/strptime
Even though all the conversion functionality was moved from
Date to Calendar, then Date is still the basic point in time
type - the time_t of Java. So it did not go away.
Arne