package com.rrtx.services.common.converter;

import com.rrtx.services.common.utils.DateUtil;
import com.wuwenze.poi.convert.WriteConverter;
import com.wuwenze.poi.exception.ExcelKitWriteConverterException;
import lombok.extern.slf4j.Slf4j;

import java.text.ParseException;

/**
 * ClassName: TimeConverter<br>
 * Description:  Execl导出时间类型字段格式化 <br>
 * Company: rrtx
 *
 * @author rrtx
 * @version v1.0.0    2019/7/24 4:44 PM  xugz    文件初始创建
 */
@Slf4j
public class TimeConverter implements WriteConverter {
	@Override
	public String convert(Object value) {
		if (value == null)
			return "";

		return DateUtil.formatCSTTime(value.toString(), DateUtil.FULL_TIME_SPLIT_PATTERN);
	}
}
