package com.cirle.scientific.utils;

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

public class UUID {

	public synchronized static String getUUID() {
		StringBuffer strBuf = new StringBuffer(java.util.UUID.randomUUID()
				.toString());
		// 27508ac9-32f1-4391-aaa3-cd2950100019
		strBuf.deleteCharAt(8);
		strBuf.deleteCharAt(12);
		strBuf.deleteCharAt(16);
		strBuf.deleteCharAt(20);
		return strBuf.toString();
	}

	public static String getTimeID() {

		SimpleDateFormat formatee = new SimpleDateFormat("yyyyMMddHHMMSS");
		Date datea = new Date();
		String dateea = formatee.format(datea);
		long dat = datea.getTime();
		String c_order = dateea + dat;

		// System.out.println(c_order);
		return c_order;
	}

	public static String getTimeOrderid() {

		SimpleDateFormat formatee = new SimpleDateFormat("yyyyMMddHHMMSS");
		Date datea = new Date();
		String dateea = formatee.format(datea);

		String c_order = dateea;

		// System.out.println(c_order);
		return c_order;
	}

	public static void main(String args[]) {
		System.out.println(UUID.getUUID());
	}
}
