Hello everyone,
Is it possible to generate the current date or timeStamp as Feeder? I need to update the timestamp for each injection…Could anyone help?
Thanks a lot,
Grace
Hello everyone,
Is it possible to generate the current date or timeStamp as Feeder? I need to update the timestamp for each injection…Could anyone help?
Thanks a lot,
Grace
A feeder is one way. Here is another:
`
import java.util.Date
import java.text.SimpleDateFormat
object ISO_TIMESTAMP {
val isoFormat = “yyyy-MM-dd’T’HH:mm:ssZ”
def format( d: Date ) =
new SimpleDateFormat( isoFormat ).format( d )
override def toString = format( new Date() )
}
`
To use it, you would save the object into the session, like so:
`
…exec( session => session.set( “CURRENT_DATE_TIME”, ISO_TIMESTAMP ) )
`
Now, every time you reference ${CURRENT_DATE_TIME} in an expression, it will always populate with the current date/time.
If you need a date/time that doesn’t automatically update, you can do that easily enough with:
`
…exec( session => session.set( “TRANSACTION_TIMESTAMP”, ISO_TIMESTAMP.toString ) )
`
Thanks a lot! It works