# Real-time analog clock, problem :(

**URL:** <https://forum.kirupa.com/t/real-time-analog-clock-problem/61846>\
**Category:** flash\
**Created:** [August 22, 2004, 4:08pm UTC](https://forum.kirupa.com/t/real-time-analog-clock-problem/61846 "2004-08-22T16:08:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![axilant](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@axilant](https://forum.kirupa.com/u/axilant)\
**Post date:** [August 22, 2004, 4:08pm UTC](https://forum.kirupa.com/t/real-time-analog-clock-problem/61846/1 "2004-08-22T16:08:38Z")

</div>

How can i make the code below update every second, so its real time in seconds, minutes, hours and such. Im new to this actionscript. Im putting everything in the liubrary, not sure if that matters or helps anything :-/ If you need to see what my problem, is just ask my, i will upload the fla 🙂

Heres the code:

```auto

 	days = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
 	months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
 	clipDate = new Date();
 
 
 	//dayName = days[clipDate.getDay()];
 	//fullDate = months[clipDate.getMonth()]+" "+clipDate.getDate()+", "+clipDate.getFullYear();
 	currentHour = clipDate.getHours();
 	currentMinutes = clipDate.getMinutes();
 	if (length(currentMinutes) == 1) {
 		currentMinutes = "0"+currentMinutes;
 	}
 	clipDate = new Date();
 	currentSeconds = int(clipDate.getSeconds());
 	if (length(currentSeconds) == 1) {
 		currentSeconds = "0"+currentSeconds;
 	}
 	currentTime = currentHour+":"+currentMinutes+"."+currentSeconds;
 	delete clipDate;
 

```

Thanks,  
Cody

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2004, 5:50pm UTC](https://forum.kirupa.com/t/real-time-analog-clock-problem/61846/2 "2004-08-22T17:50:22Z")

</div>

[http://actionscript-toolbox.com/dateobject.php](http://actionscript-toolbox.com/dateobject.php)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 22, 2004, 7:16pm UTC](https://forum.kirupa.com/t/real-time-analog-clock-problem/61846/3 "2004-08-22T19:16:02Z")

</div>

thankss problem solved 🙂
