Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Special Interests > Visual Media > Web Design and Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Oct 22, 2012, 07:25 PM   #1
jacob.3336
macrumors newbie
 
Join Date: Jul 2012
PHP Time Of Day

I am making a web application.

One thing is needs to do is get the time of day
so it can say for example in the evening:

"Good Evening, User"

I have tried an if statement:

PHP Code:
function timeofday(){

if (
$Time <= "5:00 PM") {
return 
"Evening";
}else{

if (
$Time <= "12:00 PM") {
return 
"Afternoon";
}else{

if (
$Time <= "5:00 AM") {
return 
"Morning";
}
}

It doesn't work.
Does anybody know how I could make it work.
jacob.3336 is offline   1 Reply With Quote

 
MacRumors Forums > Special Interests > Visual Media > Web Design and Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:42 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC