• Edgar Alberto Romero Popoca
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1
I have a controller variable of time datatype.
public Time startTime{get;set;}

startTime = Time.newInstance(12,0,0,0);
Rendering the variable as is on visualforce will output as 12:00:00.000Z

I want to display this on a visualforce page in a proper time format using the outputText parameter passing technique.
I tried 
<apex:outputText value="{0, time, h:mm a}">
     <apex:param value="{!slot.startTime}" /> 
I'm getting a compile time error "The value attribute on <apex:outputText> is not in a valid format. It must be a positive number, and of type Number, Date, Time, or Choice.". Anybody knows the correct syntax to get this working.

I know we can convert this variable as a datetime variable and use that instead, but wondering why Time variable does not work.