JavaTweets

Blog on Java Programming and Interview Questions

Date & Calendar Examples



  • How to Add or Subtract Date in Java
  • How To Compare two java.util.Date objects using Date.CompareTo() method
  • How To Compare two java.util.Date objects using Date.Before(), Date.After() And Date.Equals()
  • How To Compare two java.util.Date objects using Calendar.Before(), Calendar.After() And Calendar.Equals()
  • How To Compare two java.util.Date objects using Calendar.CompareTo()
  • How to Format Dates and Times using SimpleDateFormat in Java
  • How to convert String to Date in java?
  • Convert date string from one format to another format using SimpleDateFormat
  • How to Add or Subtract time using Calendar in Java
  • Add or subtract weeks to current date using Java Calendar
  • How To Get Current Date Time in Java
  • Get current TimeZone using Java Calendar
  • Display Current Time in Different Time Zones in Java
  • Create a Date object using the Calendar class
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Home
Subscribe to: Comments (Atom)

Total Pageviews

Blog Archive

  • ▼  2012 (254)
    • ▼  August (44)
      • When should I use an interface instead of an abstr...
      • Compare two StringBuffer objects in Java
      • New Java 7 Features: Using String in the Switch St...
      • Comparing String with StringBuilder in Java
      • Comparing String with StringBuffer in Java
      • Difference between == , equals and equalsIgnoreCase
      • Java String to byte Array Example
      • Java Substring Example
      • Java String to Upper Case example
      • Java String to Lower Case example
      • Java String isEmpty Example
      • Java String Reverse Example
      • Java String Trim Example
      • Java String Split Example
      • Java String Replace Example
      • Java String Length Example
      • Determining If a String Contains a Substring in Java
      • Java String Concatenation and Performance
      • Java String Compare using compareTo and compareToI...
      • Java String methods - indexOf() and lastIndexOf()
      • Searching a String for a Character or a Substring ...
      • Java Char Array To String Example
      • Convert String to Character Array Example
      • Copy all the key-value pairs from one Map into ano...
      • Get Tail Map from Java TreeMap example
      • Get Head Map from Java TreeMap example
      • Get Sub Map from Java TreeMap example
      • Get lowest and highest key stored in Java TreeMap ...
      • Get Synchronized Map from Java TreeMap example
      • Remove value from Java TreeMap example
      • Remove all values from Java TreeMap example
      • Get Size of Java TreeMap Example
      • Check if a particular value exists in Java TreeMap...
      • Check if a particular key exists in Java TreeMap e...
      • How to get all keys in Java TreeMap?
      • Get Set view of Keys from Java TreeMap example
      • Iterate through the values of Java TreeMap example
      • Simple Java TreeMap example
      • Checked vs Unchecked Exceptions in Java
      • Creating user defined exceptions in Java
      • Exception Handling : Throws clause in Java
      • Difference between throw and throws in Java?
      • How to Throw Exceptions in Java
      • What is finally block in java?
    • ►  July (134)
    • ►  June (13)
    • ►  May (2)
    • ►  April (10)
    • ►  March (14)
    • ►  February (18)
    • ►  January (19)
  • ►  2011 (3)
    • ►  December (3)

Categories

  • Home
  • SCJP Objective Questions
  • ArrayList Examples
  • Date & Calendar Examples
  • Files and I/O
  • java.util.zip
  • LinkedList Examples
  • Object Cloning
  • Serialization
  • Wrapper classes
  • Collections Framework
  • Multithreading
  • HashSet Examples
  • TreeSet Examples
  • Utility class - Collections
  • HashMap Examples
  • String Examples
  • TreeMap Examples
  • Exception Handling

Search This Blog

Followers

blog status

Popular Posts

  • Copying and Cloning Sets: public Object clone()
    Calling the clone() method of a HashSet creates a shallow copy of that HashSet.(the elements of the set aren't duplicated. Both sets wi...
  • How To Compare two java.util.Date objects using Date.Before(), Date.After() And Date.Equals()
    We can use the following methods of java.util.Date class to compare two java.util.Date objects for ordering. public boolean before(Date wh...
  • How to remove duplicate element from array?
    This example demonstrates you how to remove duplicate elements from an array using the java.util.HashSet class. import java.util.Arrays...
  • Get Size of Java TreeSet Example
    This example shows how to get the size or number  of elements of a Java TreeSet using size method. import java.util.TreeSet; public cl...
  • Add elements at beginning and end of LinkedList Java example
    This java example shows how to add an element at beginning or at end of java LinkedList object using addFirst and addLast methods. impor...
  • How to convert String to Date in java?
    The SimpleDateFormat class offers a method called parse( ), which can be used to parse a string into java.util.Date object according to the ...
  • How To Compare two java.util.Date objects using Date.CompareTo() method
    We can use Date.compareTo() method to compare two java.util.Date objects for ordering. public int compareTo(Date anotherDate) where...
  • How to convert ArrayList to Set in Java with Example
    Converting ArrayList to Set in Java means creating a Set implementation like HashSet from an ArrayList full of objects.Before Converting you...
  • Convert date string from one format to another format using SimpleDateFormat
    SimpleDateFormat  is a concrete class for formatting (date -> text) and parsing(text -> date) dates in a locale-sensitive manner.  Th...
  • How to Add or Subtract time using Calendar in Java
    The  java.util.Calendar  allows us to do a date arithmetic function such as add or subtract a unit of time to the specified date field. The ...
Powered by Blogger.