Here you can find the source of generateSyncEventId()
public synchronized static String generateSyncEventId()
//package com.java2s; import java.text.SimpleDateFormat; public class Main { static long sequence = 0; public synchronized static String generateSyncEventId() { if (sequence == Long.MAX_VALUE) sequence = 0;/* w w w . j a v a2 s . co m*/ return convertLongToDateString(System.currentTimeMillis(), "yyyy-MM-dd hh:mm:ss") + "-" + String.format("%20d", sequence++); } public static String convertLongToDateString(long mills, String format) { SimpleDateFormat sdf = new SimpleDateFormat(format); String date = sdf.format(mills); return date; } }