Forum Discussion
4 Replies
Sort By
- SmartBear_SuppoSmartBear Alumni (Retired)Hi,
Please check the syntax. That does not appear to be correct as "java.lang.String.format" is not a constructor.
Regards,
SmartBear Support - hutabarat2014ContributorHi SmartBear,
Would you please tell me what is the right constructor?
Many thanks,
Leo - SmartBear_SuppoSmartBear Alumni (Retired)Hi Leo,
I believe it should be String, but as this is a Java question, I suggest you search the Java API for the correct syntax.
Regards,
Giscard
SmartBear Support - nmraoChampion Level 3Is this the output you are looking for?
SU20140730094629693
Here is the script
StringBuilder sb = new StringBuilder()
Formatter formatter = new Formatter(sb, Locale.US)
log.info formatter.format("SU%tY%<tm%<td%<tH%<tM%<tS%<tL", new Date())
You may also want the value to a variable, just add below statement.def formattedString = sb.toString()