Knowledge Base

How to configure counters, clocks, and dates in cPanel

This article describes how to use cPanel's CGI Center to generate dynamic counters, clocks, and dates for your web site.

Types of counter objects

You can use cPanel's CGI Center to create counters, clocks, and date displays for your web site:

  • Counter: This is a simple counter that displays the number of times a web page has been accessed. With a counter on your home page, you can keep track of how many visitors have looked at your web site since the counter was created.
  • Clock: This is a simple clock that displays the time for a particular time zone. The clock updates each time the page is loaded.
  • Date: This is a simple date display that you can customize to display dates in a number of different formats.

You can customize all of these objects. You can:

  • Select a display style from a large number of available styles, and customize the display style further.
  • Customize the border around the object.
  • Specify date and time display formats.

You can preview your customizations to the object before you add the HTML code to your web pages.

Creating a counter, clock, or date

To create a counter, clock, or date, follow these steps:

  1. In the Software/Services section of the cPanel home screen, click CGI Center. The CGI Center page appears.
  2. Click Counter.
  3. Under Please select functionality, click Counter, Clock, or Date.
    • If you are creating a clock object, select the time zone in the Time Zone list box, and then select the format in the Time Format list box.
    • If you are creating a date object, select the date format in the Date Format list box.
      MM represents the month, DD represents the day, and YY represents the year. For example, if you select the MMDDYY format, the date December 27, 2014 is displayed as 12-27-2014. If you select the DDMMYY format, the same date is displayed as 27-12-2014.
  4. In the Frame Thickness text box, type the border thickness that you want to display around the object.

    Type 0 (zero) to remove the border.

  5. Type the red, green, and blue values for the border color.

    Alternatively, click the multi-colored square icon and click the color that you want. The red, green, and blue values fill in automatically.

  6. If you are creating a counter object, select the maximum number of displayed digits in the Max Digits list box.

  7. In the Style list box, select the object's style.

    To see examples of all of the styles, click See Styles.

  8. In the Counter Name text box, type the name of the object.

    You cannot use the same object name twice. Each object must have a unique name.

  9. To preview the object's appearance, click preview. You can continue to change and preview the object's settings until you are satisified with its final appearance.

  10. Click html. Copy and paste the HTML code into your web page.

  11. Upload the web page to your web site and make sure the object displays correctly.

Resetting a counter's value

You can reset a counter's value to zero, or to another number if necessary.

You can only reset the value for a counter. Setting a value for a clock or date object has no effect.

To reset a counter's value, follow these steps:

  1. In the Software/Services section of the cPanel home screen, click CGI Center. The CGI Center page appears.
  2. Click Counter.
  3. Under Edit/Reset a Counter, type the counter name in the Counter Name text box.
  4. In the New Count text box, type the counter's new value.
  5. Click Commit Changes.
  6. Load a web page that uses the counter, and verify that the counter has been reset to the new value.