[SalesForce] How to display two times from date/time column

I have two date/time fields which hold the duration of an event (i.e. start time = 11/11/14 12:00, end time = 11/11/14 18:00)

I would like to display this as 12:00 – 18:00 on my force.com page, how can I do this via outputText?

EDIT
This is the code I am currently using:

visualforce

<apex:page showheader="false" controller="force_NewsController" title="News Archive" >
<apex:composition template="{!$Site.Template}">
<apex:define name="body">  
...
            <apex:form id="pgBlock">
            <apex:repeat value="{!newsitems}" var="article" id="theRepeat">
...
                                <apex:outputText value="{!article.Event_Date_Start__c}" />
                                <apex:outputText value="{0,date,HH:mm } - {1,date,HH:mm }">
                                    <apex:param value="{!article.Event_Date_Start__c}" /> 
                                    <apex:param value="{!article.Event_Date_End__c}" />
                                </apex:outputText>
...

controller

public with sharing class force_NewsController {
    public list<News__c> lstItem {get;set;}
    public map<id,string> newsmap{get;set;}

...


    public list<News__c> getNewsItems(){
        lstItem = new list<News__c>();

        String category = Apexpages.currentPage().getParameters().get('cat');
        String query = 'SELECT Id, Name, Title__C, Content__c, Publish_Date__c, Category__c, Event_Date_Start__c, Event_Date_End__c, ';
        query += '(Select Id, Name, LastModifiedDate From Attachments Order By LastModifiedDate DESC) ';
        query += 'FROM News__c ';

        lstItem = Database.query(query);
        return lstItem;
    }

...

I have checked to make sure the view and field level security allow the profile to view the data also but I am still unable to view the data.

Best Answer

<apex:outputText value="{0,date,HH:mm } - {1,date,HH:mm }">
         <apex:param value="{!article.Event_Date_Start__c}" /> 
         <apex:param value="{!article.Event_Date_END__c}" />
</apex:outputText>
Related Topic