Java Hour Format formattedTime(long epochTime)

Here you can find the source of formattedTime(long epochTime)

Description

Member Functions

License

Open Source License

Declaration


public static String formattedTime(long epochTime) 

Method Source Code


//package com.java2s;
/*/*from  w w  w  .j a va 2  s  . co  m*/
 * This file is part of Transitime.org
 * 
 * Transitime.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (GPL) as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Transitime.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Transitime.org .  If not, see <http://www.gnu.org/licenses/>.
 */

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

public class Main {
    private static final DateFormat siriDateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");

    /********************** Member Functions **************************/

    public static String formattedTime(long epochTime) {
        return siriDateTimeFormat.format(new Date(epochTime));
    }
}

Related

  1. formatStrToDate(String value, String pattern)
  2. formattedDate()
  3. formattedDate(java.util.Date date, String formatString)
  4. formattedDateToDate(String str)
  5. formattedStringToDate(String date)
  6. formattedTimeForFilenames()
  7. formatterDate(Date date, byte format)
  8. formatterFor(final Thread t)
  9. formatTime(Date d)