2

I have to use JEXL expression and I need to get current year and month using JEXL. Is it possible?

1 Answers1

1

You can use JETT which allow to invoke static methods in JEXL code:

ETT extends JEXL to allow references to static methods directly in JEXL Expressions

Then you can call (Java 8) LocalDateTime.now method to get current date and time:

${java.time.LocalDateTime.now()}
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • 1
    I am using Apache-Syncope. It prevents using JETT in JEXL expretions... Is there any way without using java? – alireza ranjbaran May 24 '18 at 17:02
  • can you provide a snippet code of this example ? I've installed JETT but I still having error on executing ${java.time.LocalDateTime.now()} – Kenji Mukai Jul 15 '21 at 22:05