• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Clock

Clock displays server or client datetime live. AutoSync feature in server mode can sync the clock with server periodically.

Clock Tag Documentation

Clock displays server or client datetime live.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
autoSync boolean false false Syncs time periodically in server mode.
converter Converter false EL expression resolves to a converter instance or literal converter ID defining a component converter.
displayMode String false digital Display mode, valid values are digital(default) and analog.
mode String false client Mode of the client, valid values are client and server.
pattern String false Datetime format.
syncInterval int false 60000 Defines the sync interval in autoSync mode.
timeZone Object false TimeZone.getDefault() String or a java.util.TimeZone instance to specify the timezone used for date conversion.
value Object false Value of the component.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc
Client
Server
Custom
Analog

Usage


<style>
    .ui-analog-clock {
        width: 200px;
    }
</style>

<div class="card">
    <h:form>
        <h5 class="mt-0">Client</h5>
        <p:clock />

        <h5>Server</h5>
        <p:clock pattern="HH:mm:ss dd.MM.yyyy" mode="server"/>

        <h5>Custom</h5>
        <p:clock mode="server" value="#{clockView.dateTime}"/>

        <h5>Analog</h5>
        <p:clock displayMode="analog"/>
    </h:form>
</div>