Linked Questions

1 vote
2 answers
15k views

In my code I've a scenario like this : <?php $start = "03:00:00:am"; $end = "08:00:00:pm"; if($start > $end) {} ?> I tried with unix timestamp but it didnt worked.
Riyad Mohammad's user avatar
-3 votes
3 answers
13k views

actually I have 2 DateTime objects $d1 = new DateTime('04/14/2013 8.00 AM'); $d2 = new DateTime('04/14/2013'); so without doing any changes to these 2 objects. is it possible equal these 2 objects.
user2047701's user avatar
0 votes
2 answers
2k views

I have a couple of date times : DateTime {#2205 ▼ +"date": "1970-01-01 12:30:00.000000" +"timezone_type": 3 +"timezone": "UTC" } DateTime {#2206 ▼ +"date": "1970-01-01 20:00:00.000000" +"...
Farzan Najipour's user avatar
0 votes
1 answer
124 views

I am trying to pass a message if the set time has passed. I have two variables the $date1 which is the current time and the $date2 which is the target time. The third variable $interval is the ...
Danstan Ongubo's user avatar
-2 votes
1 answer
54 views

From an API call i get the following date I suppose as a string format : [end_date] => 2018-09-20 Now I have my own created date in my PHP script: $date = '2017-09-20'; Now I want to check if ...
Kevin.a's user avatar
  • 4,346
1 vote
0 answers
49 views

Here, I want to get hours between two dates. If I subtract time between two dates, I want 23 hours in a result. My field's datatype is as datetime. My code is like, $usr_check_login = $this -> ...
Viral Bhoot's user avatar
0 votes
0 answers
32 views

We're trying to fix the PHP code (from php programmer who was fired few weeks ago) to make sure these dates does not exceed more than 28 days on the form. When the customer fills out the application ...
Christian Luneborg's user avatar
161 votes
13 answers
321k views

How can I compare two dates in PHP? The date is stored in the database in the following format 2011-10-2 If I wanted to compare today's date against the date in the database to see which one is ...
Exploit's user avatar
  • 6,426
129 votes
4 answers
246k views

I'm trying to write a script that will check if the current date/time is past the 05/15/2010 at 4PM How can I use PHP's date() function to perform this check?
dave's user avatar
  • 7,907
12 votes
5 answers
29k views

I have time saved in database like 7:30pm as a varchar field. I want to check if this time is greater than time right now or not. I converted the DB time string into '19:30' and now I want to do ...
sri_wb's user avatar
  • 349
0 votes
4 answers
10k views

Start Time, End Date and End Time variables. The Date Variables are formatted yyyy-mm-dd The Time Variables are formatted hh-mm (however only on hour numbers are usable, e.g Minutes is always 00) ...
Ryan's user avatar
  • 71
4 votes
4 answers
8k views

I have a DateTime Object which holds an past timestamp. I would now like to check if this DateTime is older than for example 48Hours. How can I compore them best? Regards EDIT: Hi, thanks for the ...
bodokaiser's user avatar
  • 15.8k
0 votes
2 answers
2k views

Hello i want to check if the current time is between two time range and calculate the difference between them, so far i have this but its not working $current_time = "11:14 pm"; $start_time = "11:00 ...
Sam's user avatar
  • 47
0 votes
3 answers
1k views

I've looked at many posts on here and I still cant figure this out. I am trying to verify that someone is older than 13 before they register for my site. This is what i have so far <?php if (...
Travis Hallet's user avatar
1 vote
1 answer
809 views

I have this code in php that I could not run in PHP 5.2.9 please give me an Idea to convert this code to work on PHP 5.2.9 Thanks, $startTime = new DateTime(date('h:i:s a')); $endTime = new DateTime("...
RicardO's user avatar
  • 1,219

15 30 50 per page