Java Date Format Pattern getFormatToSecsForFilename()

Here you can find the source of getFormatToSecsForFilename()

Description

Returns a date format to the resolution of seconds, for use in filenames:

yyyy-MM-dd_HH-mm-ss

License

Apache License

Return

The result

Declaration

public static SimpleDateFormat getFormatToSecsForFilename() 

Method Source Code

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

import java.text.SimpleDateFormat;

public class Main {
    public static final String FORMAT_TO_SECS_FOR_FILE = "yyyy-MM-dd_HH-mm-ss";

    /**//from w  ww .  ja v a 2 s. c  o  m
     * Returns a date format to the resolution of seconds, for use in filenames:
    * <p>
     * <code>
     * yyyy-MM-dd_HH-mm-ss
     * </code>
    * 
    * @return The result
     */
    public static SimpleDateFormat getFormatToSecsForFilename() {
        return new SimpleDateFormat(FORMAT_TO_SECS_FOR_FILE);
    }
}

Related

  1. getFormatter()
  2. getFormatter()
  3. getFormatter(final String pattern)
  4. getFormatter(String pattern)
  5. getFormatters()
  6. getHeaderFormat()
  7. getLenientFormat(String format)
  8. getMM()
  9. getMM(Date date)