Java Timestamp Create getTimestampFromDateTime(DateTime dateTime)

Here you can find the source of getTimestampFromDateTime(DateTime dateTime)

Description

get Timestamp From Date Time

License

Open Source License

Declaration

public static Timestamp getTimestampFromDateTime(DateTime dateTime) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Timestamp;
import java.util.TimeZone;
import org.joda.time.DateTime;

public class Main {
    public static Timestamp getTimestampFromDateTime(DateTime dateTime) {

        TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
        Timestamp timestamp = null;
        if (dateTime != null) {
            timestamp = new Timestamp(dateTime.getMillis());
        }/*from  w ww  . ja  v  a2 s  . co m*/

        return timestamp;
    }
}

Related

  1. getTimestampFormat()
  2. getTimestampFormat()
  3. getTimestampFormatter()
  4. getTimestampFromDate(Date d)
  5. getTimestampFromDate(String d)
  6. getTimeStampFromISOString(String isoString)
  7. getTimestampFromString(String dateStr)
  8. getTimestampFromString(String dateString, String dateFormat)
  9. getTimestampFromString(String id)