🌐
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.ISe...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › › › › java › util › Date.html
Date (Java Platform SE 8 )
October 20, 2025 - Java™ Platform Standard Ed. 8 ... The class Date represents a specific instant in time, with millisecond precision.
🌐
Javatpoint
javatpoint.com › java-util-date
java.util.Date class
The class represents the only date in Java. It inherits the java.util.Date class. The instance is widely used in the JDBC because it represents the date that can be stored in a database. Overview of Purpose: Represents a date without time in JDBC.
🌐
TutorialsPoint
tutorialspoint.com › java › util › java_util_date.htm
Java Date Class
This Java example demonstrates the from() method of Date class to get Date instance of current time. package com.tutorialspoint; import java.time.Instant; // Import the Date package import java.util.Date; // Main public class public class DateDemo { public static void main(String[] args) { // create a date of current time Date date = Date.from(Instant.now()); // print the date instance System.out.println("Date: " + date.toString()); } }
🌐
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...
🌐
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.
🌐
Tutorialspoint
tutorialspoint.com › java › java_date_time.htm
Java - Date and Time
Following are the methods of the date class. This is a very easy method to get current date and time in Java. You can use a simple Date object with toString() method to print the current date and time as follows − · import java.util.Date; public class DateDemo { public static void main(String args[]) { // Instantiate a Date object Date date = new Date(); // display time and date using toString() System.out.println(date.toString()); } }
🌐
MIT
web.mit.edu › java_v1.0.2 › www › javadoc › java.util.Date.html
Class java.util.Date
All Packages Class Hierarchy This Package Previous Next Index · 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.
🌐
GeeksforGeeks
geeksforgeeks.org › java › util-date-class-methods-java-examples
util.date class methods in Java with Examples - GeeksforGeeks
September 8, 2021 - // Java Program explaining util.date ... // class having access to Date class methods public class NewClass { public static void main(String[] args) { Date mydate = new Date(); // Displaying the current date and time ...
Find elsewhere
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › class-use › Date.html
Uses of Class java.util.Date (Java Platform SE 8 )
October 20, 2025 - Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
🌐
Baeldung
baeldung.com › home › java › java dates › java.util.date vs java.sql.date
java.util.Date vs java.sql.Date | Baeldung
January 8, 2024 - Class java.util.Date stores a date-time value as milliseconds since the epoch.
🌐
Scaler
scaler.com › home › topics › java.util.date class
java. util.Date Class - Scaler Topics
December 13, 2022 - It is a class that extends java. util.Date class. It is used to represent SQL DATE, which keeps years, months, and days. No time data is kept. Here the date is stored as milliseconds since 1st January 1970 00:00:00 GMT.
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › util › Date.html
Date (Java Platform SE 7 )
Java™ Platform Standard Ed. 7 ... The class Date represents a specific instant in time, with millisecond precision.
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.

🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › util › class-use › Date.html
Uses of Class java.util.Date (Java SE 17 & JDK 17)
January 20, 2026 - A thin wrapper around java.util.Date that allows the JDBC API to identify this as an SQL TIMESTAMP value. ... Compares this Timestamp object to the given Date object.
🌐
Classpath
developer.classpath.org › doc › java › util › Date-source.html
Source for java.util.Date (GNU Classpath 0.95 Documentation)
*/ 37: 38: package java.util; 39: ... java.text.DateFormat; 45: import java.text.SimpleDateFormat; 46: 47: /** 48: * <p> 49: * This class represents a specific time in milliseconds since the epoch....
🌐
How to do in Java
howtodoinjava.com › home › java date time › guide to java.util.date class
Guide to java.util.Date Class - HowToDoInJava
February 17, 2022 - Learn to create new date, get current date, parse date to string or format Date object using java.util.Date class.
🌐
Jenkov
jenkov.com › tutorials › java-date-time › java-util-date.html
Java's java.util.Date
Java's java.util.Date class was one of Java's first date classes. Today most of the methods in the class are deprecated in favor of the java.util.Calendar class.
🌐
Groovy
docs.groovy-lang.org › latest › html › groovy-jdk › java › util › Date.html
Date (Groovy JDK enhancements)
import static java.util.Calendar.YEAR def date = new Date() def nextYear = date[YEAR] + 1 date.set(year: nextYear) println date