SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

UTIL PACKAGE / NOTES</>↗
Util Package20 Jan 2024

Differences between getEncoder() and getUrlEncoder() method of java.util.Base64 class

The java.util.Base64.getEncoder() and java.util.Base64.getUrlEncoder() methods in Java both return a Base64 encoder. However, they exhibit different behaviors mainly due to the encoding scheme they follow for handling URL and filename safe characters. java.util.Base64.getEncoder(): This method returns a Base64.Encoder that encodes using the Basic type base64 encoding scheme as per RFC 4648 Section 4. Basic Base64 […]

Wayan · 4 min read
JAVA 8 / NOTES</>↗
Java 820 Jan 2024

How do I convert LocalDate to ZonedDateTime?

You can use the atStartOfDay() method from LocalDate class to convert a LocalDate into a LocalDateTime. Then, you need to convert LocalDateTime to a ZonedDateTime using the atZone() method. Here is an example: package org.kodejava.datetime; import java.time.*; public class LocalDateToZonedDateTimeExample { public static void main(String[] args) { // Create a LocalDate LocalDate date = LocalDate.of(2023, […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 820 Jan 2024

How do I convert datetime between time zones?

The ZonedDateTime class is part of the Java Date-Time Package (java.time.*), released in Java 8 to address the shortcomings of the old date-time classes such as java.util.Date, java.util.Calendar, and java.util.SimpleDateFormat. Some of the key features are: It represents a date-time with a timezone in the ISO-8601 calendar system, such as ‘2007-12-03T10:15:30+01:00 Europe/Paris’. It provides a […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 819 Jan 2024

What is ZoneRules class of Java Date-Time API?

The ZoneRules class in Java’s Date-Time API is used to encapsulate the set of rules defining how the zone offset varies for a single time zone. The information in this class is typically derived from the IANA Time Zone Database (TZDB). The rules model the data traditionally contained in the ‘zic’ compiled data files of […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 818 Jan 2024

How do I use java.time.ZoneId class?

java.time.ZoneId is a class in Java’s Date-Time API used to represent a time zone identifier. This identifier is used to get a ZoneRules, which then can be used to convert between an Instant and a LocalDateTime. Here is how you can use the ZoneId class in a simple way: package org.kodejava.datetime; import java.time.ZoneId; import java.time.ZonedDateTime; […]

Wayan · 2 min read
JAVA 8 / NOTES</>↗
Java 818 Jan 2024

How do I use java.time.Instant class of Java Date-Time API?

The java.time.Instant class in the Java Date-Time API is an immutable representation of a point in time. It stores a long count of seconds from the epoch of the first moment of 1970 UTC, plus a number of nanoseconds for the further precision within that second. The java.time.LocalDate class represents a date without a time […]

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.