Java yyyy formatHL7TSFormat4Date(Date time)

Here you can find the source of formatHL7TSFormat4Date(Date time)

Description

format HLTS Format Date

License

Open Source License

Declaration

public static String formatHL7TSFormat4Date(Date time) 

Method Source Code

//package com.java2s;
/*//from  ww  w .ja v  a 2s . c o  m
 * Copyright (C) 2009 Tolven Inc

 * This library is free software; you can redistribute it and/or modify it under the terms of 
 * the GNU Lesser General Public License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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 Lesser General Public License for more details.
 *
 * Contact: info@tolvenhealth.com 
 *
 * @author anil
 * @version $Id: HL7DateFormatUtility.java,v 1.1 2009/04/06 00:50:26 jchurin Exp $
 */

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

public class Main {
    private static final String HL7TSFormat4 = "yyyy";

    public static String formatHL7TSFormat4Date(Date time) {
        return getSimpleDateFormat(HL7TSFormat4).format(time);
    }

    private static SimpleDateFormat getSimpleDateFormat(String format) {
        return new SimpleDateFormat(format);
    }
}

Related

  1. formatDicomDate(String dicomDate)
  2. formatearDateToString(Date date)
  3. formatFecha(Date fecha)
  4. formatFromDate(Date date)
  5. formatG(Date date)
  6. formatJJJJMMTT(long time)
  7. formatPGNDate(final Date pDate)
  8. formatRTGSDate(java.util.Date date)
  9. formatShortDate(Date date)