Java Hour Format formatValue(Object value)

Here you can find the source of formatValue(Object value)

Description

format Value

License

Open Source License

Declaration

public static String formatValue(Object value) 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    private final static SimpleDateFormat formatStoring = new SimpleDateFormat(
            "dd.MM.yyyy HH:mm:ss");

    public static String formatValue(Object value) {

        if (value == null) {
            return "\"NULL\"";
        }// w  w  w  .j  a  va  2  s.  c  om

        if (value instanceof Date) {
            Date date = (Date) value;
            return "\"" + formatStoring.format(date) + "\"";
        } else {
            return "\"" + value + "\"";
        }

    }
}

Related

  1. formatToSec(Date date)
  2. formatToString(Date date)
  3. formatUIDate(Calendar calendar)
  4. formatUnixFileListing(final Date d)
  5. formatUnsignedVersion(String ver)
  6. formatVerbose(int level, String message, String source)
  7. formatW3CDateTime(Date date)
  8. formatW3CDateTime(Date date)
  9. formatWCPDate(String date, String sFormat)