Do you absolutely have to use java.util.Date? I would thoroughly recommend that you use Joda Time or the java.time package from Java 8 instead. In particular, while Date and Calendar always represent a particular instant in time, with no such concept as "just a date", Joda Time does have a type representing this (LocalDate). Your code will be much clearer if you're able to use types which represent what you're actually trying to do.

There are many, many other reasons to use Joda Time or java.time instead of the built-in java.util types - they're generally far better APIs. You can always convert to/from a java.util.Date at the boundaries of your own code if you need to, e.g. for database interaction.

Answer from Jon Skeet on Stack Overflow
🌐
w3resource
w3resource.com › java-exercises › datetime › java-datetime-exercise-40.php
Java - Display current date, time without time, date
Write a Java program to display only the time component of the current date-time using formatting techniques.
🌐
W3Schools
w3schools.com › java › java_date.asp
Java Date and Time
Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. The package includes many date and time classes.
Discussions

How do I get a Date without time in Java? - Stack Overflow
Continuing from Stack Overflow question Java program to get the current date without timestamp: What is the most efficient way to get a Date object without the time? Is there any other way than th... More on stackoverflow.com
🌐 stackoverflow.com
Converting String to Time without Date in Java - Stack Overflow
You can't have a Date without the calendar date parts. That's a simple fact of what Date represents: The class Date represents a specific instant in time, with millisecond precision. ... represent[s] the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT. You can use LocalTime in java... More on stackoverflow.com
🌐 stackoverflow.com
May 23, 2017
java.util.date - get Date without time in java - Stack Overflow
The new Java 8 date and time API has much better classes for all date and time operations. More on stackoverflow.com
🌐 stackoverflow.com
What's are best practices when dealing with dates, without time-of-day?
4 is the usual standard. More on reddit.com
🌐 r/AskProgramming
6
1
May 19, 2022
🌐
W3Docs
w3docs.com › java
How do I get a Date without time in Java?
To get a java.util.Date object with the time set to 00:00:00 (midnight), you can use the toInstant() method to convert a LocalDate object to an Instant, and then use the atZone() method to convert the Instant to a ZonedDateTime object, and finally use the toLocalDate() method to extract the LocalDate from the ZonedDateTime.
🌐
Baeldung
baeldung.com › home › java › java dates › get date without time in java
Get Date Without Time in Java | Baeldung
March 12, 2025 - In the next sections, we’ll show some common workarounds to tackle this problem. One of the most common ways to get a Date without time is to use the Calendar class to set the time to zero.
🌐
Codemia
codemia.io › knowledge-hub › path › how_do_i_get_a_date_without_time_in_java
How do I get a Date without time in Java?
3 weeks ago - Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Medium
medium.com › @AlexanderObregon › beginners-guide-to-handling-date-and-time-in-java-cc2fcc5b13f1
Beginner’s Guide to Handling Date and Time in Java
March 19, 2024 - Let's dive into the key classes introduced by the java.time package and understand their use cases: LocalDate represents a date without time of day or timezone information, such as 2024-04-11.
🌐
Medium
medium.com › @alxkm › how-to-work-with-dates-in-java-a-complete-guide-203b7e657648
How to Work with Dates in Java: A Complete Guide | by Alex Klimenko | Medium
August 9, 2025 - Prefer classes from the java.time package over legacy Date and Calendar. Use LocalDate when you only need a date without time or time zone.
Find elsewhere
🌐
W3Schools
w3schools.in › java › date-time
Java Date & Time - W3Schools
Java Date class is one of the Java's oldest class, and most of the methods in the class are deprecated, but we can still use it to represent a date though. Date and time contained in a java.util.Date instance, and accessible by using predefined methods.
🌐
Quora
quora.com › How-can-I-print-current-time-of-the-system-without-date-in-Java
How to print current time of the system without date in Java - Quora
Answer (1 of 2): Try this. If d[3] doesnt print it, try d[4] or d[2] [code]public static void main(String args[]) { java.util.Date date = new java.util.Date(); String[] d = date.toString().split("\\s+"); System.out.println(d[3]); } [/code]
🌐
W3Schools
w3schools.com › js › js_temporal_plaindatetime.asp
W3Schools.com
A Temporal.PlainDateTime represents a date and time without a time zone.
🌐
Coderanch
coderanch.com › t › 389201 › java › Time-date
Time without date. Help! (Beginning Java forum at Coderanch)
July 15, 2001 - I have managed to return the full date/time value in html (i.e. including day, date, year, timezone), but all I actually want is the time of day, not the day/date/year etc. So, for example, I can create an html document with: "Sun Jul 02 23:00:00 GMT+01:00 2001" When all I actually want to display is: "23:00" Can anyone help me? Some sample code would be really useful. Thanks in advance, James ... Hi, James. Try something like this: Running this code returns but of course, the way I set it up, the specific value you see will depend on when you run it. For more on java.text.SimpleDateFormat, i.e., what characters you can pass in its constructor's String, click here.
🌐
W3Schools
w3schoolsua.github.io › java › java_date_en.html
Java Date and Time. Lessons for beginners. W3Schools in English
Java does not have a built-in Date class, but we can import the java.time package to work with the date and time API. The package includes many date and time classes.
🌐
Blogger
javarevisited.blogspot.com › 2015 › 03 › 20-examples-of-date-and-time-api-from-Java8.html
Java 8 Date Time - 20 Examples of LocalDate, LocalTime, LocalDateTime
October 18, 2021 - LocalDate today = LocalDate.now(); System.out.println("Today's Local date : " + today); Output Today's Local date : 2014-01-14 You can see that it has created today's date without any time information. It also prints the date in a nicely formatted way, unlike the previous Date class which prints data non-formatted. You can also see Java SE 8 for Really Impatient to learn about different ways to create LocalDate in Java 8.
🌐
Medium
medium.com › @YodgorbekKomilo › mastering-date-and-time-in-java-a-comprehensive-guide-ff0ae133537d
Mastering Date and Time in Java: A Comprehensive Guide | by Yodgorbek Komilov | Medium
December 14, 2024 - Java’s date-time API is part of the java.time package. Here are the most important classes: LocalDate: Represents a date without time (e.g., 2024-11-10).
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-8-date-localdate-localdatetime-instant
Java 8 Date: LocalDate, LocalDateTime, Instant Guide | DigitalOcean
August 3, 2022 - All the Date classes are mutable, so they are not thread-safe. It’s one of the biggest problems with Java Date and Calendar classes. Date class doesn’t provide internationalization, there is no timezone support.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Date.html
Date (Java Platform SE 8 )
2 weeks ago - This Date object is modified so that it represents a point in time within the specified minute of the hour, with the year, month, date, hour, and second the same as before, as interpreted in the local time zone. ... Deprecated. As of JDK version 1.1, replaced by Calendar.get(Calendar.SECOND). Returns the number of seconds past the minute represented by this date. The value returned is between 0 and 61. The values 60 and 61 can only occur on those Java Virtual Machines that take leap seconds into account.
🌐
Reddit
reddit.com › r/askprogramming › what's are best practices when dealing with dates, without time-of-day?
r/AskProgramming on Reddit: What's are best practices when dealing with dates, without time-of-day?
May 19, 2022 -

What is best practice when dealing with date values without time, in JavaScript? My concern is subtle off-by-one bugs caused by local Time Zone (TZ) offset (e.g. +5 hours), when doing date math.

JavaScript's built-in Date type represents a date and time not just the date. Internal representation is an integer of microseconds since 1970-01-01 00:00:00 UTC. Other languages, like Python, have separate Date and DateTime types. Java 8 introduced LocalDate.

You also have things like: new Date('5/18/2020') is local TZ (in US), but new Date('2022-05-18') is UTC. Same with Date.parse(string). And the time zone on most servers in UTC, whereas on the browser side the time zone will vary.

The date values will be used for simple date math in code and will be stored in a SQL database.

Possibilities:

  1. Use the an alternate type like integer value, of milliseconds or days (since 1970-01-01), or string in YYYYMMDD format.

  2. This was combined with #1

  3. Use Date ignoring time (as 00:00 local TZ). Convert from/to UTC when reading/writing to database

  4. Use Date with time as 00:00 UTC. Have to be careful not to mix with Date values in local TZ (e.g. now = new Date())

  5. Use Date in local TZ, but convert to UTC when read/writing to database. This is a variant of #3.

  6. Create a LocalDate class that enforces midnight.

  7. Use a library. js-joda has LocalDate.

I am leaning towards #3 and #6. Some code I am writing:

class LocalDate extends Date {
  // Error if time isn't midnight local TZ
  // Do not accept string in ISO format
  constructor(date?: Date|number|string)

  // Convert to 00:00 UTC
  // To be used before write to database
  toUtc(): Date

  // Only return date.  Also affects toJSON()
  toISOString(): string

  // Returns today's date at 00:00 Local TZ
  static today(): LocalDate
  // Set time to midnight local TZ, without error check.
  static fromDateTime(date: Date|number): LocalDate
  // Convert to local TZ.  Error if not 00:00 UTC.
  static fromUtc(date: Date|number): LocalDate
}

UPDATE:

Various edits.