Android examples for java.text:SimpleDateFormat
get Timestamp string in yyyy-MM-dd'T'HH:mm:ss format
import java.text.SimpleDateFormat; import java.util.Date; import java.util.UUID; public class Main{ public static String getTimestamp() { // ISO-8601 combined date and time format SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); return sdf.format(new Date()); }//from www. ja v a 2 s.co m }