Day of Year function for use in an expression?


#1

Does it exist (somewhere that I haven’t looked)?

If not, how would I go about calculating it? I’m thinking milliseconds since start of year, but I’m hoping someone has a much more elegant solution than I would probably come up with.


#2

I believe that you’re looking for formatDateTime($now, 'D')


#3

It is! Thank you.

Is that a “WebCore” thing, or does that flow through to Java (and hence what Java/Groovy can do, WebCore can do)?


#4

I believe that this is a webCoRE function (which essentially calls some Groovy code) – see the webCoRE wiki on what functions are available.


#5

The FormatDateTime section simply has a link to the Java docs at https://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html

That initially confused me.


#6

That documentation tells you all the available format strings you can use.