# Help with applying simple code

**URL:** <https://forum.kirupa.com/t/help-with-applying-simple-code/86286>\
**Category:** Uncategorized\
**Created:** [April 11, 2005, 10:56pm UTC](https://forum.kirupa.com/t/help-with-applying-simple-code/86286 "2005-04-11T22:56:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_lauren](https://avatars.discourse-cdn.com/v4/letter/b/b38774/32.png) [@b\_lauren](https://forum.kirupa.com/u/b_lauren)\
**Post date:** [April 11, 2005, 10:56pm UTC](https://forum.kirupa.com/t/help-with-applying-simple-code/86286/1 "2005-04-11T22:56:48Z")

</div>

ok i asked a Q a few days ago (and recieved a fab reply)

> Hi  
> this is probably super simple - but then so am I!  
> Does anyone know where I may find some actionscript code that will get the time froma user’s computer and then display a message according to wether it is day or night  
> EG.  
> 1am-11am = “Good morning”  
> 12pm- 12am= “Good evening”  
> thanks in adavnce

```auto
 
mydate = new Date();
current_time = mydate.getHours();
if (current_time<11) {
	  message = "good morning";
}else if (current_time>12) {
	  message = "good evening";
}

```

but now say i have a dynamic text box (instance name message )

where do i put the AS and do i have to add an event handler

sigh it’s been so long since i’ve used flash!

thanks
