Jesper has already given you short answers to your questions.

The no-arg method LocalDate.html#now obtains the current date from the system clock in the default (system) time-zone. Therefore, when you print LocalDate.now() in Madrid, India and New York, at the same time, you may get different results (depending on what time you do it).

Demo:

import java.time.LocalDate;
import java.time.ZoneId;

public class Main {
    public static void main(String[] args) {
        System.out.println(LocalDate.now(ZoneId.of("Europe/Madrid")));
        System.out.println(LocalDate.now(ZoneId.of("Asia/Kolkata")));
        System.out.println(LocalDate.now(ZoneId.of("America/New_York")));
    }
}

Output:

2022-09-28
2022-09-29
2022-09-28

Note: to understand this difference, check the output of the following program:

import java.time.LocalDateTime;
import java.time.ZoneId;

public class Main {
    public static void main(String[] args) {
        System.out.println(LocalDateTime.now(ZoneId.of("Europe/Madrid")));
        System.out.println(LocalDateTime.now(ZoneId.of("Asia/Kolkata")));
        System.out.println(LocalDateTime.now(ZoneId.of("America/New_York")));
    }
}

Result:

2022-09-28T21:03:56.438167
2022-09-29T00:33:56.443577
2022-09-28T15:03:56.444049

However, a LocalDate object does not store the time-zone information. Therefore, when you print an object of LocalDate (i.e. LocalDate#toString), the printed value will remain the same irrespective of the system time-zone.

A java.util.Date object too does not store the time-zone information. It stores the number of milliseconds from January 1, 1970, 00:00:00 GMT. However, when you print an object of java.util.Date (i.e. Date#toString), it uses the default (system) time-zone to print the value i.e. if you print an object of java.util.Date on systems with different time-zones set to them, you will get different results.

Answer from Arvind Kumar Avinash on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › javatime › javatime_localdate_now.htm
java.time.LocalDate.now() Method Example
The java.time.LocalDate.now() method obtains the current date from the system clock in the default time-zone.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › LocalDate.html
LocalDate (Java Platform SE 8 )
3 days ago - LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. Other date fields, such as day-of-year, day-of-week and week-of-year, can also be accessed. For example, the value "2nd October 2007" can be stored in a LocalDate.
Top answer
1 of 2
3

Jesper has already given you short answers to your questions.

The no-arg method LocalDate.html#now obtains the current date from the system clock in the default (system) time-zone. Therefore, when you print LocalDate.now() in Madrid, India and New York, at the same time, you may get different results (depending on what time you do it).

Demo:

import java.time.LocalDate;
import java.time.ZoneId;

public class Main {
    public static void main(String[] args) {
        System.out.println(LocalDate.now(ZoneId.of("Europe/Madrid")));
        System.out.println(LocalDate.now(ZoneId.of("Asia/Kolkata")));
        System.out.println(LocalDate.now(ZoneId.of("America/New_York")));
    }
}

Output:

2022-09-28
2022-09-29
2022-09-28

Note: to understand this difference, check the output of the following program:

import java.time.LocalDateTime;
import java.time.ZoneId;

public class Main {
    public static void main(String[] args) {
        System.out.println(LocalDateTime.now(ZoneId.of("Europe/Madrid")));
        System.out.println(LocalDateTime.now(ZoneId.of("Asia/Kolkata")));
        System.out.println(LocalDateTime.now(ZoneId.of("America/New_York")));
    }
}

Result:

2022-09-28T21:03:56.438167
2022-09-29T00:33:56.443577
2022-09-28T15:03:56.444049

However, a LocalDate object does not store the time-zone information. Therefore, when you print an object of LocalDate (i.e. LocalDate#toString), the printed value will remain the same irrespective of the system time-zone.

A java.util.Date object too does not store the time-zone information. It stores the number of milliseconds from January 1, 1970, 00:00:00 GMT. However, when you print an object of java.util.Date (i.e. Date#toString), it uses the default (system) time-zone to print the value i.e. if you print an object of java.util.Date on systems with different time-zones set to them, you will get different results.

2 of 2
0

I don't think Question # 4 was answered well. I think it is obvious to Jasper and others but not so obvious to me and I think OP.

LocalDateTime.now() will use either system clock or provided timezone to determine what "now" is, but then removes the time zone reference. It is impossible to determine what original time zone was used to create the LocalDateTime object.

That had me wondering how does LocalDateTime.atZone(ZoneId.of("Europe/Madrid")) properly convert the LocalDateTime to Europe/Madrid timezone if there is no time zone reference point to convert from? For example, if LocalDateTime is 2022-09-28T21:03:56, how can it then convert that to Europe/Madrid when it does not understand what time zone the date/time it holds originated from?

The solution is obvious now. It doesn't convert and it does not try to figure out what timezone it originated from. It just appends the timezone specified to the date/time it has.

So if a LocalDateTime object has a value of 2022-09-28T21:03:56, then LocalDateTime.atZone(ZoneId.of("Europe/Madrid")) instantiates a ZonedDateTime object with a value of 2022-09-28T21:03:56+01:00. Notice there is no change other than adding the +01:00 offset in use by the people of that time zone at that moment.

If that particular time-of-day does not exist in that time zone at that moment, such as during a Daylight Saving Time (DST) cutover, the time-of-day in the new ZonedDateTime is adjusted logically.

After I understood those two points it was all really clear how it worked.

Hope this helps someone else that this was not that obvious for.

🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
import java.time.LocalDate; // import the LocalDate class public class Main { public static void main(String[] args) { LocalDate myObj = LocalDate.now(); // Create a date object System.out.println(myObj); // Display the current date } }
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 21 & JDK 21)
January 20, 2026 - public static LocalDate now() Obtains the current date from the system clock in the default time-zone. This will query the system clock in the default time-zone to obtain the current date. Using this method will prevent the ability to use an alternate clock for testing because the clock is ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › localdate-now-method-in-java-with-examples
LocalDate now() Method in Java with Examples - GeeksforGeeks
January 21, 2019 - public static LocalDate now() Parameters: This method accepts no parameter. Return value: This method returns the current date using the system clock and default time-zone. Below programs illustrate the now() method: Program 1: ... // Java program ...
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 17 & JDK 17)
October 20, 2025 - public static LocalDate now() Obtains the current date from the system clock in the default time-zone. This will query the system clock in the default time-zone to obtain the current date. Using this method will prevent the ability to use an alternate clock for testing because the clock is ...
🌐
Sentry
sentry.io › sentry answers › java › how do i get the current date and time in java?
How do I get the current date and time in Java? | Sentry
January 15, 2025 - import java.time.LocalDate; import java.time.LocalTime; public class Main { public static void main(String[] args) { LocalDate currentDate = LocalDate.now(); LocalTime currentTime = LocalTime.now(); System.out.println("Current Date: " + ...
Find elsewhere
🌐
How to do in Java
howtodoinjava.com › home › java date time › java localdate
Java LocalDate (with Examples) - HowToDoInJava
April 7, 2023 - LocalDate today = LocalDate.now(); //Same date 3 years later LocalDate localDate1 = today.plusYears(3); //local date before 3 months LocalDate localDate2 = today.minusMonths(3); Let’s get a better understanding of LocalDate class using some ...
🌐
Oracle
docs.oracle.com › en › java › javase › 19 › docs › api › java.base › java › time › LocalDate.html
LocalDate (Java SE 19 & JDK 19)
December 12, 2022 - public static LocalDate now() Obtains the current date from the system clock in the default time-zone. This will query the system clock in the default time-zone to obtain the current date. Using this method will prevent the ability to use an alternate clock for testing because the clock is ...
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.time.localdate.now
LocalDate.Now Method (Java.Time) | Microsoft Learn
[<Android.Runtime.Register("now", "(Ljava/time/Clock;)Ljava/time/LocalDate;", "", ApiSince=26)>] static member Now : Java.Time.Clock -> Java.Time.LocalDate
🌐
Javatpoint
javatpoint.com › java-localdate
Java LocalDate class
October 20, 2025 - Class Java's ZonedDateTime class uses a time zone to express a given date and time. Its state cannot be altered after creation since it is immutable. This class contains the time zone information along with all the date and time fields with nanosecond accuracy. It is helpful... ... Class class specifies a time zone identifier and provides a rule for converting between an Instant and a LocalDateTime.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-8-date-localdate-localdatetime-instant
Java 8 Date - LocalDate, LocalDateTime, Instant | DigitalOcean
August 3, 2022 - We have looked into most of the important parts of Java Date Time API. It’s time now to look into most important classes of Date Time API with examples. LocalDate is an immutable class that represents Date with default format of yyyy-MM-dd. We can use now() method to get the current date.
🌐
LabEx
labex.io › tutorials › java-java-localdate-current-date-117826
Mastering Java LocalDate: Discover the Current Date | LabEx
In this lab, we learned how to use the Java LocalDate now(ZoneId) method to obtain the current date from the system clock in the specified time-zone.
🌐
Java Guides
javaguides.net › 2024 › 07 › java-localdate-now-method.html
Java LocalDate now() Method
July 10, 2024 - This method obtains the current date from the system clock in the default time zone. import java.time.LocalDate; public class LocalDateNowExample { public static void main(String[] args) { LocalDate currentDate = LocalDate.now(); System.out...
🌐
CodeGym
codegym.cc › java blog › core java › java localdate class
Java LocalDate class
May 15, 2023 - import java.time.LocalDate; public class LocalDateExample { public static void main(String[] args) { LocalDate today = LocalDate.now(); System.out.println("Today's date: " + today); } } In this example, we import the LocalDate class from the ...
🌐
How to do in Java
howtodoinjava.com › home › java date time › how to format localdate in java
How to Format LocalDate in Java - HowToDoInJava
March 3, 2024 - The default format pattern is ‘yyyy-MM-dd’. LocalDate today = LocalDate.now(); //1 - Default Format is yyyy-MM-dd String formattedDate = today.toString(); //2022-02-17 //2 - Inbuilt patterns FULL, LONG, MEDIUM, SHORT DateTimeFormatter pattern ...
🌐
Studytonight
studytonight.com › java-examples › java-localdate-nowzoneid-method
Java LocalDate now(ZoneId) Method - Studytonight
November 24, 2020 - import java.time.LocalDate; import java.time.ZoneId; public class DateDemo { public static void main(String[] args){ LocalDate localDate = LocalDate.now(ZoneId.of("Asia/Tokyo")); System.out.println(localDate); } }
🌐
Studytonight
studytonight.com › java-examples › java-localdate-now-method
Java LocalDate now() Method - Studytonight
February 10, 2024 - import java.time.LocalDate; public class DateDemo { public static void main(String[] args){ LocalDate localDate = LocalDate.now(); System.out.println(localDate); } }