Java Hour Format formatUnsignedVersion(String ver)

Here you can find the source of formatUnsignedVersion(String ver)

Description

Convert long date stamp to '07-Jul 21:09 UTC' with month name in the system locale

License

Open Source License

Return

null if ver = null

Declaration

private static String formatUnsignedVersion(String ver) 

Method Source Code

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

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**/*from   w  w  w .  j av  a2 s  . co  m*/
     *  Convert long date stamp to
     *  '07-Jul 21:09 UTC' with month name in the system locale
     *  @return null if ver = null
     *  @since 0.9.4 moved from NewsFetcher
     */
    private static String formatUnsignedVersion(String ver) {
        if (ver != null) {
            try {
                long modtime = Long.parseLong(ver);
                return (new SimpleDateFormat("dd-MMM HH:mm")).format(new Date(modtime)) + " UTC";
            } catch (NumberFormatException nfe) {
            }
        }
        return null;
    }
}

Related

  1. formatToOpenMrsDate(Date date)
  2. formatToSec(Date date)
  3. formatToString(Date date)
  4. formatUIDate(Calendar calendar)
  5. formatUnixFileListing(final Date d)
  6. formatValue(Object value)
  7. formatVerbose(int level, String message, String source)
  8. formatW3CDateTime(Date date)
  9. formatW3CDateTime(Date date)