Java UUID Create generateUniqueText()

Here you can find the source of generateUniqueText()

Description

This method generates a unique string based on the current system date/time.

License

Apache License

Declaration

public static String generateUniqueText() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**// w  w w .  j av a  2s.co m
     * This method generates a unique string based on the current system
     * date/time.
     * 
     * @return
     */
    public static String generateUniqueText() {
        Date date = new Date();

        SimpleDateFormat UNIQUE_DATE_TIME_STRING_FORMAT = new SimpleDateFormat(
                "yyyyMMddHHmmSS");
        String dateTimeString = UNIQUE_DATE_TIME_STRING_FORMAT.format(date);

        return dateTimeString;
    }
}

Related

  1. GenerateUniqueID()
  2. generateUniqueID()
  3. generateUniqueID()
  4. generateUniqueId()
  5. generateUniqueString()
  6. generateUri()
  7. generateURN()
  8. generateUUID()
  9. generateUUID()