Search Tutorials
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 !
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|