[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Show'Hode content depending on time - Hours & minutes

Posted on 2013-06-27
3
Medium Priority
?
222 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
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 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