Java java.sql Date fields, constructors, methods, implement or subclass

Example usage for Java java.sql Date fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.sql Date.

The text is from its open source code.

Constructor

Date(long date)
Constructs a Date object using the given milliseconds time value.
Date(long date)
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.
Date(int year, int month, int day)
Constructs a Date object initialized with the given year, month, and day.
Date(int year, int month, int date)
Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year , month , and date arguments.

Method

booleanafter(Date when)
Tests if this date is after the specified date.
booleanbefore(Date when)
Tests if this date is before the specified date.
intcompareTo(Date anotherDate)
Compares two Dates for ordering.
booleanequals(Object obj)
Compares two dates for equality.
ClassgetClass()
Returns the runtime class of this Object .
intgetDate()
Returns the day of the month represented by this Date object.
intgetDay()
Returns the day of the week represented by this date.
intgetMonth()
Returns a number representing the month that contains or begins with the instant in time represented by this Date object.
longgetTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
intgetTimezoneOffset()
Returns the offset, measured in minutes, for the local time zone relative to UTC that is appropriate for the time represented by this Date object.
intgetYear()
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.
voidsetTime(long date)
Sets an existing Date object using the given milliseconds time value.
InstanttoInstant()
This method always throws an UnsupportedOperationException and should not be used because SQL Date values do not have a time component.
LocalDatetoLocalDate()
Creates a LocalDate instance using the year, month and day from this Date object.
StringtoLocaleString()
Creates a string representation of this Date object in an implementation-dependent form.
StringtoString()
Formats a date in the date escape format yyyy-mm-dd.
DatevalueOf(String s)
Converts a string in JDBC date escape format to a Date value.
DatevalueOf(LocalDate date)
Obtains an instance of Date from a LocalDate object with the same year, month and day of month value as the given LocalDate .