Java tutorial
//package com.java2s; import java.util.*; public class Main { public static Date toDate(String s) { if (s == null) { return null; } try { return new Date(Long.parseLong(s)); } catch (NumberFormatException e) { return null; } } }