Clock App
Last updated
Last updated
This sample application is reprinting of Think IT article released on 3/11/2013.
This sample app is a clock app displaying current Date and time.
Import Clock App to your Monaca Account
Tested Environment
Android 11.0
iOS 14.3
File
Description
index.html
The Startup page
js/app.js
The JavaScript file handling implementation in the project
css/style.css
The style Sheet for the project
images/*.png
All image files needed to use this template
The following HTML body of index.html
file is for displaying the current Date and time.
When the application is loaded, the clock()
function is called every 1 seconds (1000 ms
) by this statement:
The clock()
function is used to display the current date and time. First, it gets the current time (hour, minute and second) and then display the images (digit image) according to the time. Next, it gets the current date (day, month and year) and then display it in the format as defined in renderDay()
and renderMonth()
functions. Here is content of the clock()
function: