Formatting times for French local

We have an event content type and in the template we’re trying to display the time of the event. The issue we have run into is trying to format the date for French local.

In English the date can take the format 1:30pm, however in French it would be 13 h 30.

Has anyone done something like that? I’ve thought about using the time on the calendar field and I’ve also though about a separate field but in either case I can’t get the formatting corrected.

Shane

With a calendar field, you should be able to use $tools.date.format to get it into the format that you want… http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)

Thanks Jitendra. I was able to figure it out just before I got your reply. I think I just go myself in a tizzy, went to lunch, came back and had an eureka moment and realized it was simple.

	#set($timeHour = $tools.date.format("HH", $sys.item.getProperty("event_start").Date))
	#set($timeMin = $tools.date.format("mm", $sys.item.getProperty("event_start").Date))
	#set($time = $timeHour + ' h ' + $timeMin + ' HE')

Shane