package com.sinosig.mongodb.util;

import org.springframework.core.convert.converter.Converter;
import java.sql.Timestamp;
import java.util.Date;

public class TimestampConverter implements Converter<Date, Timestamp> {
	
	public Timestamp convert(Date date) {
		if (date != null) {
			return new Timestamp(date.getTime());
		}
		return null;
	}
}