Java Date to String date2string(Date _aDate)

Here you can find the source of date2string(Date _aDate)

Description

datestring

License

Open Source License

Declaration

public static String date2string(Date _aDate) 

Method Source Code

//package com.java2s;
/*************************************************************************
 * /* w w  w  .  j a  v a2s  .  co m*/
 *  Copyright 2009 by Giuseppe Castagno beppec56@openoffice.org
 *  
 *  The Contents of this file are made available subject to
 *  the terms of European Union Public License (EUPL) version 1.1
 *  as published by the European Community.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the EUPL.
 *
 *  This program 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
 *  EUPL for more details.
 *
 *  You should have received a copy of the EUPL along with this
 *  program.  If not, see:
 *  https://www.osor.eu/eupl, http://ec.europa.eu/idabc/eupl.
 *
 ************************************************************************/

import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static String date2string(Date _aDate) {
        final String m_dateFormatXAdES = "yyyy-MM-dd'T'HH:mm:ss'Z'";
        SimpleDateFormat f = new SimpleDateFormat(m_dateFormatXAdES);
        f.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
        String dateStr = f.format(_aDate);
        return dateStr;
    }
}

Related

  1. date2Str(Date date, String pattern)
  2. date2str(Date date, String pattern)
  3. date2Str(Date value)
  4. date2Str(final Date date, final String dateFormat)
  5. date2Str(SimpleDateFormat date_sdf)
  6. date2String(Date date)
  7. date2string(Date date)
  8. date2String(Date date)
  9. date2string(Date date)