Here you can find the source of getInviteCodeByNowDate()
public static synchronized String getInviteCodeByNowDate()
//package com.java2s; /**//w w w. ja va 2s . c om * B5mDateUtils.java * * ? ??????????? * ? ????B5mDateUtils * * ver ????? ???? ?? ?????? * ???????????????????????????????????? * V1.00 '12-05-24 iZENEsoft wiley.wang ??? * * Copyright (c) 2009 iZENEsoft Business Software corporation All Rights Reserved. * LICENSE INFORMATION */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static synchronized String getInviteCodeByNowDate() { SimpleDateFormat sdf = new SimpleDateFormat("MMddHHmmssMs");//ComConstants.SDF_YYYYMMDDHHMMSS; String dateStr = sdf.format(new Date()); return getRandomInteger() + dateStr; } public static String getRandomInteger() { int temp = (int) (Math.random() * 9999); return String.valueOf(temp); } }