Showing a message if specific times on specific days [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to show a message on my site if it's after 5:00 PM on Thursday, and the whole day Friday.
I managed to get the code to work for Friday, but don't have any idea how to also get it to show on Thursday after 5.
Here's what I have so far:
$d=date("D");
if ($d=="Fri")
{
echo 'Items may ship out after the weekend.';
}
How can I also get this to show on Thursday after 5:00?
Thanks!

You can try this:
$d=date("D");
if ($d=="Fri" || ($d=="Thu" && date("Hi")>="1700")) {
echo 'Items may ship out after the weekend.';
}

Related

Calculate time stamp from date and time given by user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In my application, the user gives 2 inputs — one is date and the other is time:
$date = date("d-M-Y");
$time=date("h:m:s");
How can I calculate a time stamp from these two variables in PHP?
actually i take the date form date picker and time from time oicker.....
If you want time stamp then use this
echo strtotime($date.' '.$time);

Get Eastern Time And Use In If Statement [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do I get and set a variable to the Eastern time zone and then use it in an "if" statement?
In one of my table I have a datetime column called gameEasternTime. Values are listed like so "2013-09-22 20:30:00"
I need to show a html div only if the Eastern time is after the time listed in my gameEasternTime column.
if ( $easternTime > schedule[gameEasternTime] ) {
echo ' <div> ';
}
Use date_default_timezone_set('America/New_York') and DateTime::format . Yes, those are links.

Online Exam conduct in my website in php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to add a page in my website by which I want conduct online exams. I want that my page is activate for 3 hours only. After 3 hours the page will submit itself as happens in online exams. Can any one give me any script how to make my page time constraint?
$time = date('Y-m-d H:i:s');
extract the hour from the date and do this
if ($hour > 10800){ // 10800 which is equal to 3 hours in seconds.
submit the exam
}
don't rely on javascript to set the time because the javascript may be disabled.

How to get date in Thursday, September 26, 2013 format? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to get date in following format Thursday, September 26, 2013.
The name of day should be full like Monday not like Mon and same for the month format.
How to get this format?
Use php date function as below.
echo date('l,F d,Y',strtotime($date));
Date Format
I got this like following way
$mydate=getdate(date("U"));
echo "$mydate[weekday], $mydate[month] $mydate[mday], $mydate[year]";
OR
$today = date(DATE_RFC822);
echo date('l,F d,Y',strtotime($today));

How to generate 3 page pay slip data on one page, using TCPDF [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
now i use TCPDF to generate dynamic pay slip for every person per page. Now i want to generate 3 pay slip per page using TCPDF,PHP.Please help me.
You will need to add to your loop:
for($x=0; $x<count($records); $x++ ) {
if( mod(x,3) == 0 ) pdf->addPage();
//--- do pdf stuff
}

Categories