Jump to content

Can some1 help me out on somthing simple to do with data and time


wesleypipes

Recommended Posts

this is how you'd display a message for the different times of the day:

[code=php:0]
<?php

$hours = date("G"); //24 hour time without leading zeros. eg. 0 or 23
if($hours >= 22 && $hours <= 3){
echo "My your up late arn\'t you!";
}elseif($hours >= 4 && $hours <= 7){
echo "My your up rather early!";
}elseif($hours >= 8 && $hours <= 12){
echo "Good morning, and how are we today?";
}elseif($hours >= 13 && $hours <= 17){
echo "Good afternoon, are we having a nice day?";
}elseif($hours >= 18 && $hours <= 21){
echo "Good evening, hope you had a nice day.";
}

?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.