Android Date String Parse convertTimeStumpToDate(String time)

Here you can find the source of convertTimeStumpToDate(String time)

Description

convert Time Stump To Date

Declaration

public static String convertTimeStumpToDate(String time) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;
import java.util.Locale;

public class Main {
    private final static SimpleDateFormat dateFormater = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm:ss", Locale.CHINA);

    public static String convertTimeStumpToDate(String time) {
        try {//from w ww  .  j  a va  2s.  c o  m
            return dateFormater.format(new Date(toLong(time) * 1000L));
        } catch (Exception e) {
            return null;
        }
    }

    public static long toLong(String obj) {
        try {
            return Long.parseLong(obj);
        } catch (Exception e) {
        }
        return 0;
    }
}

Related

  1. getDateTimeFromString(String dateTimeString, String format)
  2. convertStringToDate(String date, String time)
  3. GetDate(String time)
  4. dateTimeToDateObj(String date, String time)
  5. fromSlDateTime(final String dateString, final String timeString)
  6. convertimeStumpToDate2(String time)
  7. convertDateTimeStrFormat(String dateStr, String pattern, String newPattern)
  8. convertStringToDate(String strDate, String pattern)
  9. parse(String pattern, String date)