Java Now getInviteCodeByNowDate()

Here you can find the source of getInviteCodeByNowDate()

Description

get Invite Code By Now Date

License

Open Source License

Declaration

public static synchronized String getInviteCodeByNowDate() 

Method Source Code

//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);
    }
}

Related

  1. formatTime(Date now, String pattern)
  2. getAllnowTime()
  3. getDisplayDateNow()
  4. getFormatNowDateTime(String formatStr)
  5. getFormattedDateNow(@Nonnull final String sFormat)
  6. getShortNowTime()
  7. getStringNowTime()
  8. getStringOfNowDate(String fFormatStr)
  9. getTimeNow()