Forum Discussion
richie
4 years agoCommunity Hero
Hey Dee1978
I was a bit confused by your post - do I understand correctly - you want an inline scripting option to generate the current date time (including timezone indicator using the format corresponding to 'Thu, 01 Oct 2020 13:30:23 GMT'.
Is that correct?
The following:
${=import java.text.SimpleDateFormat; Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -0); new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z").format(cal.getTime());}
when executed generated the following in my request's payload:
"dateAttribute" : "Thu, 08 Oct 2020 00:43:03 BST"
I'm currently running this in the UK, and it's currently british summer time, hence the timezone ('z' flag) generated 'BST' in the value. Once the clocks change 'BST' will be replaced by either 'GMT' or 'UTC' (although I dont know which)
Does that answer all your question?
Cheers,
rich
Related Content
Recent Discussions
- 13 hours agoemoya
- 17 hours agoMyBalanceNow