Java Second Format getSecond()

Here you can find the source of getSecond()

Description

get Second

License

Open Source License

Declaration

public static String getSecond() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static String getSecond() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(currentTime);
        String min;//from w ww .  j  a  va 2s. c om
        min = dateString.substring(17, 19);
        return min;
    }
}

Related

  1. getFormattedDuration(int simTimeSeconds)
  2. getFullDateByMisSecond(long misSecond)
  3. getFutureDate(int seconds)
  4. getIntervalMilSeconds(String startDateStr, String endDateStr, String dateFormat)
  5. getMisSecond(String strDate)
  6. getSecond()
  7. getSecond()
  8. getSecond(Date date)
  9. getSecond(String time)