This example shows how JavaScript works with time. This very basic code may be helpful for beginners.