package daruma.sql;

import java.util.Date;
import java.util.SimpleTimeZone;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.FieldPosition;


public class SQLTimeFormatConverter
{
	private	SQLTimeFormatConverter()
	{
	}

	public	static	String	convertDateToString( Date  date )
	{
		DateFormat	f = new SimpleDateFormat
					    ( "yyyy-MM-dd HH:mm:ss" );

		f.setTimeZone( new SimpleTimeZone( 0 , "UTC" ) );

		StringBuffer	toAppendTo = new StringBuffer();


		String		s = f.format( date , toAppendTo ,
					      new FieldPosition(0) )
							    .toString();

		return( s );
	}
}
