Getting date by time In this example of creating date using the timestamp
value. We can pass the timestamp value as constructor parameter while creating
the object of java.util.Date().
Getting time in Milliseconds In the previous examples of Date class we have created
simple Date and now in this section we are going to get the current
date and time in the milliseconds.
Simple date formatter example In this section of simple date formatter example we are
going to describe you how you can use different constructors of SimpleDateFormat
class to convert the date into the specified format.
Hour Format Example
This example shows how to format hour using Format class. In this program we use a pattern of special characters to time format.
Date Format Example
This example shows how to format Date using Format class. In this program we use
a pattern of special characters to date and time format.
Java Time Zone Example In this section we have written a java program which
will take two Time Zone IDs as its argument and then convert the time between
provided time zone IDs.
Adding time span example In this example java program we have added the two time
spans with the use of add() method of Calendar class which is available
in the java.util package.
Java Subtracting Time Span In this example java program we have subtracted
the two time spans with the use of add() method of Calendar class which
is available in the java.util package.
Java Set Default Locale Locale can be set also in our java programs by using
the method setDefault() of Locale class. In this example we have set the
default locale value of our Locale with the Locale.ITALY.
Rolling Time Span in Java In the previous example of adding and subtracting time
span we have added and subtracted the time spans accordingly and since add()
method automatically do the rolling according to the calendar.
Java Date Examples In this section we will be getting the astrological
sign according to the inserted birth date by the user. To get the astrological
sign first we require to have a date object which will be providing the inserted
date by the user.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.