Java Hour Format formatSSLValid(Date validFrom, Date validTo)

Here you can find the source of formatSSLValid(Date validFrom, Date validTo)

Description

format SSL Valid

License

Open Source License

Declaration

public static String formatSSLValid(Date validFrom, Date validTo) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005-2008 Polarion Software.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:/*from   w  w  w . ja v a 2 s  . co m*/
 *    Alexander Gurov - Initial API and implementation
 *    Gabor Liptak - Speedup Pattern's usage
 *******************************************************************************/

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {
    public static String formatSSLValid(Date validFrom, Date validTo) {
        DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); //$NON-NLS-1$
        return "from " + df.format(validFrom) + " until " + df.format(validTo); //$NON-NLS-1$ //$NON-NLS-2$
    }
}

Related

  1. formatShortTime()
  2. formatSimpleTimeAndDateString(Date date)
  3. formatSingleFractionHours(Double updatedHours)
  4. formatSQL(Date date)
  5. formatSqlDateTime(Date value)
  6. formatStringTime(String dateTime)
  7. formatStringTimeToLong(String timeLine)
  8. formatStrToDate(String strDate, int format)
  9. formatStrToDate(String value, String pattern)