Java Random Date getDateRand()

Here you can find the source of getDateRand()

Description

get Date Rand

License

Open Source License

Declaration

public static String getDateRand() 

Method Source Code


//package com.java2s;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import java.util.Locale;
import java.util.Random;

public class Main {
    private static Random random = null;

    public static String getDateRand() {
        Calendar c = Calendar.getInstance(Locale.CHINA);
        Date d = c.getTime();//from w w  w .j a v a 2  s .c  o  m
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        return sdf.format(d) + (int) (Math.random() * 10);
    }
}

Related

  1. generateRandomDate()
  2. getDateRand(Date date)
  3. getDateRandom()
  4. getDateRandomId()
  5. getRandomDate()