I confirm that you can use the EnvInject plugin with a Groovy script:
Here is the Groovy script:
// Generate a global BUILD_ID_LONG variable with date and time
// =======================================
TimeZone.setDefault(TimeZone.getTimeZone('UTC'))
def now = new Date()
def map = [BUILD_ID_LONG: now.format("yyyyMMdd_HHmm")]
return map
Next, you can use the ${BUILD_ID_LONG} variable in your build steps.