Get String From Date : Data Type cast « Data Type « Java

Get String From Date


import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Util{
    public static String getStringFromDate (Date date) throws ParseException {
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
      return formatter.format(date);



Related examples in the same category

1.Cast a float or double to an integral valueCast a float or double to an integral value
2.A simple casting demo
3.Casting Demo
4.Get the minimum and maximum value of a primitive data types?
5.Class with methods for type conversion
6.Data type conversion
7.Data type Conversion Util
8.Convert Byte array to Int
9.Convert Number To Target Class
10.Convert byte array to Long
11.Convert long to Bytes
12.Conversion utilities
13.Get Time From Date
14.A method used to build a date for use Marker XML and KML data
15.A method used to build a date for display in line with existing formatting rules