Java Long Number to Time toLongString(long ms)

Here you can find the source of toLongString(long ms)

Description

to Long String

License

Apache License

Declaration

public static String toLongString(long ms) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static String toLongString(long ms) {
        return format(ms, "yyyy-MM-dd HH:mm:ss.SSS");
    }//www  .  j a  va2  s.c  o  m

    public static String format(long ms, String pattern) {
        DateFormat df = new SimpleDateFormat(pattern);
        return df.format(new Date(ms));
    }
}

Related

  1. stringTime(long time)
  2. stringTolong(String time)
  3. time2Date(Long time)
  4. time2DATETIME(long time)
  5. toLong(String time)
  6. toTextTime(long time)
  7. transformDateTime(long t)