Java Date ISO Parse toIsoString(Calendar value)

Here you can find the source of toIsoString(Calendar value)

Description

to Iso String

License

Open Source License

Declaration

public static String toIsoString(Calendar value) 

Method Source Code

//package com.java2s;
/**//  w w w  .j a  va  2 s . com
 *  
 * Copyright (c) 2016 Fannie Mae, All rights reserved.
 * This program and the accompany materials are made available under
 * the terms of the Fannie Mae Open Source Licensing Project available 
 * at https://github.com/FannieMaeOpenSource/ezPie/wiki/License
 * 
 * ezPIE? is a registered trademark of Fannie Mae
 * 
 */

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

public class Main {
    protected static SimpleDateFormat _sdfISO = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

    public static String toIsoString(Date value) {
        return (value == null) ? "" : _sdfISO.format(value);
    }

    public static String toIsoString(Calendar value) {
        return (value == null) ? "" : toIsoString(value.getTime());
    }
}

Related

  1. strongCheckIso8601Date(String date)
  2. time2StringISO(Date date)
  3. timestampAsIsoString(long timestamp)
  4. toCalendar(final String iso8601string)
  5. toDate(String isoDate)
  6. toIsoString(Date date)
  7. toStringForComparison(Date date)
  8. tryParse(String isoDateTime)