Android Long to Date Convert getLongOfString(String date)

Here you can find the source of getLongOfString(String date)

Description

get Long Of String

Declaration

public static long getLongOfString(String date) 

Method Source Code

//package com.java2s;

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static long getLongOfString(String date) {
        String dateStr2 = date;/* ww w . j a v  a  2 s. c  o  m*/
        ParsePosition pos2 = new ParsePosition(0);
        SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd");

        Date strtodate2 = formatter2.parse(dateStr2, pos2);
        long dateLong2 = strtodate2.getTime();
        return dateLong2;
    }
}

Related

  1. getFriendlyDate(Context context, long timestamp)
  2. getHour(long dateTimeMillis)
  3. getHour(long timeMillis)
  4. getHoursAndMinutes(long dateTimeMillis)
  5. getLocalTimeFromUTCMillis(long utcMillis)
  6. getMinute(long dateTimeMillis)
  7. getMinutesSinceStartOfDay(long milliseconds)
  8. getMonth(long dateTimeMillis)
  9. getNameForDcim(long time)