First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Johan Jansen

3 An extra option if your time is ahead or behind ( Hours only )

Setting the time ahead or behind, this is a bit more difficult. Some people mailed me about this topic,bcause for some reason my clock are some hours ahead or behind.

For each hour you set the clock ahead or behind there is another code, so I explain how this works.

If your time is one hour behind you must set the clock one hour ahead.

Use the follwing code to set the time one hour ahead time = mydate.getHours() + 1; explain : the + 1 is to add one hour to the current time.

There is only one problem if it is 23 hours at the clock the time will be set to 24 hours , but this number has to zero ( 0 ) so have have to set the time manually to zero

by using if statements. Like this code : if (time == 23) { time = "0"; }

If you fully want to understand how this works , you can study my example, I made the time from 4 hours behind till 4 hours ahead.


While writing this tutorial, the time passed by and I discovered several errors in my Beta_setting_time_ahead.fla, so the time won't be set to the correct value. I wasn't able to fix these, I hope someone can and will tell me how !

Good Luck !

» Level Advanced

Added: 2001-02-01
Rating: 6 Votes: 34
(10 being the highest)
» Author
I am 17 years old , live in Holland, near Rotterdam. Last your I passed my HAVO exams, now I doing VWO. I like to create games and other amzing things with flash, I prefer Flash 4 as tool, I can't get used to flash 5, besides most people have / use the flash 4 plugin.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.