if (isCalledAs("current-dateTime")) {
// do nothing, result already in right form
} else if (isCalledAs("current-date")) {
result = result.convertTo(Type.DATE);
} else if (isCalledAs("current-time")) {
result = result.convertTo(Type.TIME);
} else {
throw new Error("Can't handle function " + mySignature.getName().getLocalName());
}
if (context.getProfiler().isEnabled()) {context.getProfiler().end(this, "", result);}
return result;