1

I'm having trouble converting a string to a date object in a Liferay 6 GA2 web content template.

I've tried my hand using the tools available ( Access Objects in Liferay )

I've even tried importing Java classes like:

#set ($foo = "2012-12-06")
#set ($bar = $portal.getClass().forName('java.text.SimpleDateFormat'))
$bar.parse($foo)

Nothing has worked so far. Any ideas?

TIA

cp3
  • 2,119
  • 2
  • 22
  • 27

1 Answers1

0
#set($foo="20121206")
#set($format=$dateUtil.getISOFormat($foo))
$format.parse($foo)
lucky
  • 147
  • 5