Hi
I'm trying to create a specific Date in a Confluence user-macro:
#set($dateString = "2025-01-01")
#set($dateFormat = $action.getDateFormat("yyyy-MM-dd"))
#set($date = $dateFormat.parse($dateString))
<p>date: $date .getTime()</p>
#set( $currentDate = $action.dateFormatter.getCalendar())
<p>currentDate: $currentDate.getTime()</p>
gives the following output:
date: $date.getTime()
currentDate: Thu Aug 14 08:43:04 UTC 2025
why is the 1st block with a "custom" date not working?
i also tried this:
#set($newDate = $action.dateFormatter.getCalendar().Builder().setDate(2025,1,1).build())
<p>newDate: $newDate.getTime()</p>
but this doesn't work neither:
newDate: $newDate.getTime()