?
Solved

Show'Hode content depending on time - Hours & minutes

Posted on 2013-06-27
3
Medium Priority
?
219 Views
Last Modified: 2013-06-27
Thanks to the wonderful Ray Paseur I have a script working which hides content if it's after one o'clock.

 <?php if (date('H') < 13) : ?>

What I need to do now is change this to 1.30. Any ideas how i would change the code below to do this?

I've tried  <?php if (date('H') < 13.30) : ?> & <?php if (date('H') < 13.5) : ?> with no joy...
0
Comment
Question by:BrighteyesDesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Accepted Solution

by:
Robert Saylor earned 2000 total points
ID: 39281220
try H.i instead of H
0
 
LVL 9

Expert Comment

by:TvMpt
ID: 39281223
$x = date('G.i') ;
if ($x < 13.5) {
 // do something
}

Open in new window

0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39281228
Try this... untested but probably OK in principle.

<?php if (date('H:i') < '13:30') : ?>

Ref: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question