0

I am using Anypoint Studio 6.1 and Mule 3.8.1 and I want to set a variable with todays date and time e.g. Thu, 2 Mar 2017 22:00:28 GMT but the variable is set it is being set as Thu, 2 Mar 2017 22:00:28 UTC. How can I force it to show in GMT in the application as I cannot change server settings for this?

My MEL expression that does this is:

#[server.dateTime.format("EEE, d MMM yyyy HH:mm:ss z")]

Thanks

user3165854
  • 1,505
  • 8
  • 48
  • 100

2 Answers2

1

Here's the MEL you need on that scenario:

[server.dateTime.withTimeZone('GMT').format('EEE, d MMM yyyy HH:mm:ss z')]

Community
  • 1
  • 1
Errol Carrasco
  • 261
  • 3
  • 3
1

This can be helpful just a forum blog post.If you are looking for MEL the above answer would be enough

https://support.mulesoft.com/s/article/ka434000000TOwlAAG/How-to-properly-set-the-TimeZone-in-Mule-Mule-Runtime-and-CloudHub

Satheesh Kumar
  • 797
  • 7
  • 31