Android Date String Parse convertimeStumpToDate2(String time)

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

Description

convertime Stump To Date

Declaration

public static String convertimeStumpToDate2(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 dateFormater2 = new SimpleDateFormat(
            "yyyy-MM-dd", Locale.CHINA);

    public static String convertimeStumpToDate2(String time) {
        try {//from ww  w. j a  v  a 2s  .  co  m
            return dateFormater2.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. convertStringToDate(String date, String time)
  2. GetDate(String time)
  3. dateTimeToDateObj(String date, String time)
  4. fromSlDateTime(final String dateString, final String timeString)
  5. convertTimeStumpToDate(String time)
  6. convertDateTimeStrFormat(String dateStr, String pattern, String newPattern)
  7. convertStringToDate(String strDate, String pattern)
  8. parse(String pattern, String date)
  9. parse3339(String time)