First, create the timeStamp string using this code block:
{
String DATE_FORMAT="yyyyMMdd_HHmmss-SSS";
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(DATE_FORMAT);
return sdf.format(new Date());
}
Then generate a random number with this code:
{
java.util.Random nahcis = new java.util.Random();
return nahcis.nextInt(9999).toString();
}
And in the end just concatenate:
"recording_" + timeStamp + "_" + randomNumber
This will create a string like:
"recording_20100120_134541-214_6592"
And this is something you can use as the file name.
legend.. this solved my problem with an IPIVR script
ReplyDeletehi, i'm a newbie here, can u guys tell me how to do this? i wish to have my datetime in string format...
ReplyDeletethanks, howyi