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

Similar Threads
thread Thread Starter Forum Replies Last Post
[php] - php problems os x mountain lion 10.8.2 cakas6933 OS X 10.8 Mountain Lion 4 Jun 10, 2014 08:08 AM
Calendar bug in 7.1 B3 when selecting day and time. richard371 iOS 7 2 Jan 17, 2014 07:17 PM
What time in the day did your 5S/5C deliver? ethereal45 iPhone 16 Oct 17, 2013 09:17 AM
Time Machine Backup Once Per Day, Possible? 2012Tony2012 iMac 7 Dec 3, 2012 05:39 AM
Restoring to previous day w/o Time Machine EvanMcKnight OS X 1 Sep 23, 2012 10:34 AM

Forum Jump

All times are GMT -5. The time now is 05:52 PM.

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

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