package com.changhong.epc.count.service.system.func.set.date; import com.changhong.epc.count.service.system.func.set.AbsFuncSupper; import com.changhong.epc.count.service.tool.SystemFunTool; import com.googlecode.aviator.runtime.type.AviatorObject; import com.googlecode.aviator.runtime.type.AviatorString; import com.iemsoft.framework.cloud.core.tools.DateTool; import java.util.Map; /** * 获取时间函数 * @author wangZX * */ public class DateFuntion extends AbsFuncSupper { @Override public AviatorObject call(Map env, AviatorObject arg1) { String dateStr = SystemFunTool.getStringVal(arg1, env); String format = format(dateStr, DateTool.DATE_TO_STRING_DETAIAL_PATTERN); return new AviatorString(format); } @Override public AviatorObject call(Map env, AviatorObject arg1,AviatorObject arg2) { String dateStr = SystemFunTool.getStringVal(arg1, env); String form = SystemFunTool.getStringVal(arg2, env); String format = format(dateStr, form); return new AviatorString(format); } @Override public String getName() { return FUNC_DATE_GET_DATE; } }