Just follow the javadoc, as it says:

public String toString()

Converts this Date object to a String of the form:

dow mon dd hh:mm:ss zzz yyyy

zzz is the time zone (and may reflect daylight saving time).

And when you dive into the source code, that this toString() implementation will at some point use TimeZone.getDefault() ( or to be precise: getDefaultRef()). In other words: the default implementation pulls in the "default" timezone of your JVM.

Answer from GhostCat on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Date.html
Date (Java Platform SE 8 )
October 20, 2025 - java.util.Date · All Implemented ... class Date extends Object implements Serializable, Cloneable, Comparable<Date> The class Date represents a specific instant in time, with millisecond precision....
🌐
GeeksforGeeks
geeksforgeeks.org › java › util-date-class-methods-java-examples
util.date class methods in Java with Examples - GeeksforGeeks
September 8, 2021 - Syntax: public String toString() Return: a string representation of the given date. .setTime() : java.util.Date.setTime() method is a java.util.Date class method.
Discussions

Should java.util.Date be deprecated?
I recently had to tell a co-worker not to use SimpleDateFormat in completely new code. If it was marked deprecated I guess this would not have been needed. More on reddit.com
🌐 r/java
159
221
May 10, 2022
java.util.Date and getYear() - Stack Overflow
Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone. It is also marked as deprecated. Use java.util.Calendar instead. More on stackoverflow.com
🌐 stackoverflow.com
Convert String to java.util.Date - Stack Overflow
I am storing the dates in a SQLite database in this format: d-MMM-yyyy,HH:mm:ss aaa When I retrieve the date with that format I am get every thing fine except the hour. The hour is always 00. Her... More on stackoverflow.com
🌐 stackoverflow.com
Converting a string into a java.util.Date
I have a string i created with python to input to a Popup Calender. When I try to link it to the date, I get the Error: can't convert 'Thu Aug 21 16:56:40 EDT 2014' to java.util.Date How do i convert a string into… More on forum.inductiveautomation.com
🌐 forum.inductiveautomation.com
0
0
June 17, 2014
Top answer
1 of 3
4

Just follow the javadoc, as it says:

public String toString()

Converts this Date object to a String of the form:

dow mon dd hh:mm:ss zzz yyyy

zzz is the time zone (and may reflect daylight saving time).

And when you dive into the source code, that this toString() implementation will at some point use TimeZone.getDefault() ( or to be precise: getDefaultRef()). In other words: the default implementation pulls in the "default" timezone of your JVM.

2 of 3
3

tl;dr

Current moment in UTC.

Instant.now()    // Capture current moment in UTC.
    .toString()  // Generate String in standard ISO 8601 format.

2018-01-23T01:23:45.677340Z

Current moment in India time zone.

ZonedDateTime.now( 
    ZoneId.of( "Asia/Kolkata" ) 
).toString()    // Generate string in format wisely extended from ISO 8601 standard, adding the time zone name in square brackets.

2018-01-23T06:53:45.677340+05:30[Asia/Kolkata]

Avoid legacy date-time classes

Why does java.util.Date object show date & time with respect to a timezone when in actuality, java.util.Date represents an instant on the time-line, not a "date"?

Because the java.util.Date and related classes (Calendar, SimpleDateFormat, and such) are poorly-designed. While a valiant effort at tackling the tricky subject of date-time handling, they fall short of the goal. They are riddled with poor design choices. You should avoid them, as they are now supplanted by the java.time classes, an enormous improvement.

Specifically to answer your question: The toString method of Date dynamically applies the JVM’s current default time zone while generating a String. So while the Date object itself represents a moment in UTC, the toString creates the false impression that it carries the displayed time zone.

Even worse, there is a time zone buried inside the Date object. That zone is used internally, yet is irrelevant to our discussion here. Confusing? Yes, yet another reason to avoid this class.

A java.util.Date instance has no concept of time-zone.

Not true. A Date represents a specific moment, a point on the timeline, with a resolution of milliseconds, in UTC. As you mention, it is defined as a count of milliseconds since the first moment of 1970 in UTC.

java.time

The java.time classes separate clearly the concepts of UTC, zoned, and unzoned values.

The java.time.Instant class represents a moment on the timeline in UTC with a resolution of nanoseconds (up to nine (9) digits of a decimal fraction). This class replaces java.util.Date.

Instant instant = Instant.now() ;  // Capture current moment in UTC.

Apply a time zone (ZoneId object) to an Instant and you get a ZonedDateTime object. That class replaces the java.util.Calendar class.

ZoneId z = ZoneId.of( "Asia/Kolkata" ) ;
ZonedDateTime zdt = instant.atZone( z ) ;  // Same simultaneous moment as `instant`, but different wall-clock time.

If a value has only an offset-from-UTC but not a full time zone, use the OffsetDateTime class.

For a date only, without time-of-day and without time zone, use the LocalDate class. This class replaces the java.sql.Date class. Ditto for LocalTime replacing java.sql.Time.

LocalDate xmasDate2018 = LocalDate.of( 2018 , Month.DECEMBER , 25 ) ;

If the zone or offset are unknown or indeterminate, such as "Christmas starts at stroke of midnight on December 25, 2018", use the LocalDateTime class. This class does not represent an actual moment, a specific point on the timeline. This class lacks any concept of time zone or offset. So it can only represent potential moments along a range of about 26-27 hours.

LocalDateTime xmasEverywhere2018 = LocalDateTime.of( xmasDate2018 , LocalTime.MIN ) ;

Or…

LocalDateTime xmasEverywhere2018 = LocalDateTime.of( 2018 , Month.DECEMBER , 25 , 0 , 0 , 0 , 0 ) ;

About java.time

The java.time framework is built into Java 8 and later. These classes supplant the troublesome old legacy date-time classes such as java.util.Date, Calendar, & SimpleDateFormat.

The Joda-Time project, now in maintenance mode, advises migration to the java.time classes.

To learn more, see the Oracle Tutorial. And search Stack Overflow for many examples and explanations. Specification is JSR 310.

With a JDBC driver complying with JDBC 4.2 or later, you may exchange java.time objects directly with your database. No need for strings or java.sql.* classes.

Where to obtain the java.time classes?

  • Java SE 8, Java SE 9, and later
    • Built-in.
    • Part of the standard Java API with a bundled implementation.
    • Java 9 adds some minor features and fixes.
  • Java SE 6 and Java SE 7
    • Much of the java.time functionality is back-ported to Java 6 & 7 in ThreeTen-Backport.
  • Android
    • Later versions of Android bundle implementations of the java.time classes.
    • For earlier Android, the ThreeTenABP project adapts ThreeTen-Backport (mentioned above). See How to use ThreeTenABP….

The ThreeTen-Extra project extends java.time with additional classes. This project is a proving ground for possible future additions to java.time. You may find some useful classes here such as Interval, YearWeek, YearQuarter, and more.

🌐
CodeGym
codegym.cc › java blog › java classes › java.util.date class
Java.util.Date Class
February 14, 2025 - What is java.util.Date Class? The java.util.Date class provides the date and time in java. This class provides constructors and methods to use the current date and time. To use this class in your code you...
🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
If you don't know what a package is, read our Java Packages Tutorial. To display the current date, import the java.time.LocalDate class, and use its now() method:
🌐
Reddit
reddit.com › r/java › should java.util.date be deprecated?
r/java on Reddit: Should java.util.Date be deprecated?
May 10, 2022 - And this is the reason why java.util.Date will likely never be marked as deprecated for removal. Removing that class will probably break binary compatibility with every JDBC driver and application out there. Except if the JVM somehow intercedes and makes it work out.
Find elsewhere
🌐
Jon Skeet's Coding Blog
codeblog.jonskeet.uk › 2017 › 04 › 23 › all-about-java-util-date
All about java.util.Date | Jon Skeet's coding blog
May 23, 2017 - A Date instance represents an instant in time, not a date. Importantly, that means: It doesn’t have a time zone. It doesn’t have a format. It doesn’t have a calendar system. ... java.util.Date (just Date from now on) is a terrible type, which explains why so much of it was deprecated in Java 1.1 (but is still being used, unfortunately).
🌐
Coderanch
coderanch.com › t › 428375 › java › add-days-currentDate-java-util
add 10 days to currentDate in java.util.Date or cast to Calendar? (Beginning Java forum at Coderanch)
January 28, 2009 - I know, I can add or substract days, years,.. from an actual Calenar-Instance. But how can I do it with the java.util.Date? For example Date myDate = new Date(); myDate.setMonth(a.getMonth()+1); But setMonth is depraceted, so I should use Calendar. But how can I convert /cast a Calendar-Instance to a Date-Instance, when I need the Date?
🌐
Duke
www2.cs.duke.edu › csed › java › jdk1.4.2 › docs › api › java › util › Date.html
Date (Java 2 Platform SE v1.4.2)
Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the parse(java.lang.String) method.
🌐
MIT
web.mit.edu › java_v1.0.2 › www › javadoc › java.util.Date.html
Class java.util.Date
java.lang.Object | +----java.util.Date · public class Date · extends Object A wrapper for a date. This class lets you manipulate dates in a system independent way.
🌐
Medium
medium.com › codex › java-date-format-5a2515b07c2c
Java Date Format with Examples. java. util.Date | by Maneesha Nirman | CodeX | Medium
November 12, 2022 - Let's have an idea of methods and constructors that can be found in util. Date class. But I am not going to discuss deprecated methods and constructors. ... This constructor initializes and allocates the Date object with the current date and time.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.util.date.-ctor
Date Constructor (Java.Util) | Microsoft Learn
Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT. Java documentation for java.util.Date.Date(long).
🌐
Inductive Automation
forum.inductiveautomation.com › ignition
Converting a string into a java.util.Date - Ignition - Inductive Automation Forum
June 17, 2014 - I have a string i created with python to input to a Popup Calender. When I try to link it to the date, I get the Error: can't convert 'Thu Aug 21 16:56:40 EDT 2014' to java.util.Date How do i convert a string into…
🌐
Apache Commons
commons.apache.org › proper › commons-lang › apidocs › org › apache › commons › lang3 › time › DateUtils.html
DateUtils (Apache Commons Lang 3.20.0 API)
java.lang.Object · org.apache.commons.lang3.time.DateUtils · public class DateUtils extends Object · A suite of utilities surrounding the use of the Calendar and Date object. DateUtils contains a lot of common methods considering manipulations of Dates or Calendars.
🌐
Oracle
docs.oracle.com › javame › config › cldc › ref-impl › cldc1.0 › jsr030 › java › util › Date.html
java.util Class Date
java.lang.Object | +--java.util.Date · public class Date · extends Object · The class Date represents a specific instant in time, with millisecond precision. This Class has been subset for the MID Profile based on JDK 1.3. In the full API, the class Date had two additional functions.
🌐
Android Developers
developer.android.com › api reference › date
Date | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.util.date
Date Class (Java.Util) | Microsoft Learn
The class Date represents a specific instant in time, with millisecond precision. [Android.Runtime.Register("java/util/Date", DoNotGenerateAcw=true)] public class Date : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Lang.ICloneable, Java.Lang.IComparable