Here you can find the source of convertDateForExcel(String timestamp)
Parameter | Description |
---|---|
timestamp | A FLAME timestamp string |
Parameter | Description |
---|---|
ParseException | Invalid timestamp |
public static String convertDateForExcel(String timestamp) throws ParseException
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static final String flameDateFormat = "yyyyMMdd_HHmm_ss"; public static final String excelDateFormat = "MM/dd/yyyy HH:mm:ss"; /**/*from w w w . j a v a 2 s .c o m*/ * Converts the time from FLAME format to Excel-friendly format * @param timestamp A FLAME timestamp string * @return An Excel-friendly timestamp string * @throws ParseException Invalid timestamp */ public static String convertDateForExcel(String timestamp) throws ParseException { SimpleDateFormat date_format = new SimpleDateFormat(flameDateFormat); SimpleDateFormat excel_format = new SimpleDateFormat(excelDateFormat); Calendar c = Calendar.getInstance(); c.setTime(date_format.parse(timestamp)); return excel_format.format(c.getTime()); } }