Sujet : Re: VMS Software Bootcamp 2024
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 18. Sep 2024, 02:02:12
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <66ea2693$0$709$14726298@news.sunsite.dk>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 9/17/2024 8:37 PM, Lawrence D'Oliveiro wrote:
On Tue, 17 Sep 2024 19:40:07 -0400, Arne Vajhøj wrote:
On 9/17/2024 7:25 PM, Lawrence D'Oliveiro wrote:
I would say Java in particular is an example of how not to do it.
>
You mean that "HH:mm" and "hh:mm a" are way worse than '%H:%M' and
'%I:%M %p' ?
>
:-)
I mean, look at the mess of classes that makes up the Java date/time API.
That is a bit peripheral to the time formatting issue.
The java.time package added in Java 8 is indeed rather big and
can be hard to navigate.
The old stuff is pretty straightforward.
All one need to know is:
Date = point in time = C time_t
Calendar/GregorianCalendar = conversion between point in time and time components = C gmtime/localtime/mktime
DateFormat/SimpleDateFormat = conversion between binary and text representation = C strftime/strptime
(the java.time equivalents are Instant, LocalDateTime and
DateTimeFormatter)
Arne