Java Random Date getDateRand(Date date)

Here you can find the source of getDateRand(Date date)

Description

get Date Rand

License

Apache License

Declaration

public static String getDateRand(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");

    public static String getDateRand(Date date) {
        String str = sdf.format(date);
        double d = Math.random();
        int t = 1000 + (int) (d * 9000.0D);
        return str + t;
    }//from  w ww .  j a  v a  2  s. c o  m
}

Related

  1. generateRandomDate()
  2. getDateRandom()
  3. getDateRand()
  4. getDateRandomId()
  5. getRandomDate(Random ran, boolean idNewID)
  6. getRandomDate()