Java SQL Date From toDate(Object o)

Here you can find the source of toDate(Object o)

Description

to Date

License

LGPL

Declaration

public static Date toDate(Object o) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.sql.Timestamp;

import java.util.Date;

public class Main {
    public static Date toDate(Object o) {
        Date result = null;//  ww w. j  a v  a 2s . c  om
        if (o instanceof Timestamp) {
            result = o != null ? new Date(((Timestamp) o).getTime()) : null;
        }
        return result;
    }
}

Related

  1. toDate(Calendar cal)
  2. toDate(int value)
  3. toDate(java.sql.Date sqlDate)
  4. toDate(java.util.Date date)
  5. toDate(Object date)
  6. toDate(Object obj)
  7. toDate(Object value)
  8. toDate(String dateString)
  9. toDate(String s)