Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getTimeStamp() { Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); return sdf.format(cal.getTime()); } }