Search found 8 matches

by real_AOD
Thu Feb 13, 2003 2:47 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

There you go:

if (strftime("%H:%M",time())>"14:00" && strftime("%H:%M",time())<"16:00")
$variable=50;
elseif .......... :D
by real_AOD
Wed Feb 12, 2003 6:25 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

Hurkle! :D Peace! or Fish?

Yeah I'll learn fishing pretty soon... 8)
by real_AOD
Wed Feb 12, 2003 5:55 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

Thanks for your honesty and some bit of sarcasm hurkle. I'm really going to study programming soon and PHP will be my choice. Once I'm learned, I'll do my share of helping other newbies like me right now. I will never ever go out of my way just to impress people. I'm just in a pressure situation rig...
by real_AOD
Wed Feb 12, 2003 4:47 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

Thanks but I already have the latest searchable PHP manual in CHM format. I'm going to study it pretty soon. What I need are some tips or tricks from experienced coders right now. Here's my situation now: I want the date function to return values in seconds or minutes for a day instead of just 0 to ...
by real_AOD
Wed Feb 12, 2003 1:46 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

I have a problem on the above codes though. What if I want to breakdown the variable assignment in 30-minute intervals for example? :roll:

How do I use the date function to return the value in minutes or seconds?
by real_AOD
Wed Feb 12, 2003 1:43 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

Got these somewhere and any would suffice: ///////////////////////// <? $num = date('H'); if($num >= 1 && $num <= 6) { $variable = between 1am & 6am; } elseif($num >= 7 && $num <= 12) { $variable = between 7am and midday; } elseif($num >= 13 && $num <= 18) { $variable = b...
by real_AOD
Wed Feb 12, 2003 12:13 pm
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

I'm a complete newbie and I just want to use a simple code snippet for a pre-made script so could you be more specific on the coding? Thanks. :)
by real_AOD
Wed Feb 12, 2003 11:41 am
Forum: PHP - Code
Topic: Assign value to a variable depending on time
Replies: 14
Views: 1517

Assign value to a variable depending on time

How do I assign a value to a variable depending on the time of the day?

For example: If time is between 2am to 4pm, variable = 50.

How can I accomplish this?

Thanks for any help. :)