Java Second Format getSecond()

Here you can find the source of getSecond()

Description

Get the current second

License

LGPL

Return

The current second

Declaration

public static String getSecond() 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**//from   w  ww .  ja  v a  2 s  .  c  o m
     * Get the current second
     * @return The current second
     */
    public static String getSecond() {
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("ss");
        String output = format.format(date);
        return output;
    }
}

Related

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