

package org.iwethey.forums.web.json;

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

public class DateSerializerElement implements JsonSerializerElement
{
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

    public void serialize(Object object, JsonSerializer serializer)
    {
		if (object == null)
		{
			return;
		}

		Date date = (Date) object;

		serializer.append("\"");
		serializer.append(formatter.format(date));
		serializer.append("\"");
    }
}
