Java Date to Long formatDateToLong(Date date, String format)

Here you can find the source of formatDateToLong(Date date, String format)

Description

format Date To Long

License

Open Source License

Declaration

public static Long formatDateToLong(Date date, String format) 

Method Source Code

//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Long formatDateToLong(Date date, String format) {
        if (date == null) {
            return null;
        }// ww w .  j a va 2s .  c  o m
        return Long.valueOf(new SimpleDateFormat(format).format(date));
    }
}

Related

  1. dateToLong(Date date)
  2. dateToNumber(Date date)
  3. formatDateLong(Date date, Locale locale)
  4. formatDateToLong(String strDate, String formatstr)