Java Date Now getCurrentODSDate()

Here you can find the source of getCurrentODSDate()

Description

get Current ODS Date

License

LGPL

Declaration

public static String getCurrentODSDate() 

Method Source Code

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

import java.text.DateFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Main {
    private static Map<Integer, DateFormat> ODS_DATEFORMATS = new HashMap<Integer, DateFormat>();

    public static String getCurrentODSDate() {
        return asODSDate(new Date());
    }/* www.  j a v  a  2  s .c om*/

    /**
     * Return an ODS date from a <code>java.util.Date</code>.
     * 
     * @param date the <code>java.util.Date</code> to convert
     * @return the date in ODS date-format (YYYYMMDDhhmmss)
     */
    public static synchronized String asODSDate(Date date) {
        if (date == null) {
            return "";
        }
        return ODS_DATEFORMATS.get(14).format(date);
    }
}

Related

  1. getCurrentMonth(boolean bool, String currentDate)
  2. getCurrentMonthday()
  3. getCurrentMonthLastDay()
  4. getCurrentMonthStartTime()
  5. getCurrentMonthString(Calendar calendar)
  6. getCurrentPlainDate()
  7. getCurrentQuarter()
  8. getCurrentSecond()
  9. getCurrentString(String pattern)