Java之獲取年月日時分秒字符串

/**
	 * 生成隨機圖片文件名,年月日時分秒格式
	 */
	 String getString() {
		Date date = new Date(System.currentTimeMillis());
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
		String string = simpleDateFormat.format(date);
		return string;
	}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章