Here you can find the source of toTimestamp(DateTime dt)
public static Timestamp toTimestamp(DateTime dt)
//package com.java2s; //License from project: Apache License import org.joda.time.*; import java.sql.Timestamp; public class Main { /**/*from ww w. ja va 2 s . c o m*/ * Null-safe method of converting a DateTime to a Timestamp. * <br> * NOTE: The timestamp also should be in UTC. * @return A UTC DateTime */ public static Timestamp toTimestamp(DateTime dt) { if (dt == null) { return null; } else { return new Timestamp(dt.getMillis()); } } }