Created
August 20, 2013 19:03
-
-
Save ashrithr/6285758 to your computer and use it in GitHub Desktop.
random data generator java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.fluttercode.datafactory.impl.DataFactory; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class DateGenerator { | |
public static void main(String[] args) { | |
DataFactory df = new DataFactory(); | |
Date minDate = df.getDate(2000, 1, 1); | |
Date maxDate = new Date(); | |
DateFormat dfr = new SimpleDateFormat("MMddyyyy"); | |
for (int i = 0; i < 10; i++) { | |
Date start = df.getDateBetween(minDate, maxDate); | |
Date end = df.getDateBetween(start, maxDate); | |
System.out.println("Date range = " + dfr.format(start) + " to " + dfr.format(end)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment