I am just beginner and just started to learn php, so there should be
easy way to handle this with regular expression, how ever this can be
achieve with if else statement too.
here is sample:
<?php
putenv("TZ=America/Los_Angeles"); // Setting time to Pacific time
$hour = date("G"); // Getting hours
$week = date("N"); //Getting week 1 for Monday and 7 for
Sunday
echo $week."and Time is".$hour;
echo "<br />";
if ($week >= 1 && $week <= 2 ) //if Mon & Tues Day
{
if ($hour >= 22 && $hour < 24 ) { echo 'it\'s monday or tuesday
10pm to 12pm '; } else { echo 'it\'s not monday or tuesday 10pm to
12pm'; }
} else {
if ($hour >= 14 && $hour < 16 ) { echo 'it\'s wed to sun 2pm to
4pm'; } else { echo 'it\'s not wed to sun 2pm to 4pm'; }
}
?>
hope its help!!
On Feb 18, 10:35 am, Abhijit Gaikwad <[email protected]>
wrote:
> Hi All,
> I have a a widget that I am embeding in a web page.
> I want that widget to appear only on those specific time when I set
> it.
>
> For eg for Mon 10-12 pm , Tues 2-5 pm
>
> So I want when I open that web page I should see that widet in these
> times.
>
> I am using PHP and mysql
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---