Format Timestamp to String using mm:ss - Java java.sql

Java examples for java.sql:Timestamp

Description

Format Timestamp to String using mm:ss

Demo Code


//package com.java2s;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

public class Main {
    private static SimpleDateFormat simpleTimeFormate = new SimpleDateFormat(
            "mm:ss");

    public static String simpleDateStr(Timestamp time) {
        return simpleTimeFormate.format(time);
    }/*from   ww w. j  a v  a 2 s . c  o  m*/
}

Related Tutorials