Jump to content

Date and time help


jake2891

Recommended Posts

Hi guys, I have a form that im submitting and storing the data. What im having difficulty with is a label that I need displaying. if the date has been entered between 12.00 am and 15:59 pm then the label will be shown "new client" anything entered after 16:00 pm to 23.59pm the label wont be displayed today but should be displayed tomorrow instead. example code below.

 

when i do the insert im using php's time() function for the date_added

 

<?php

 

$sql = "SELECT *

          FROM requirements";

$query = mysql_query($sql);

$array = mysql_fetch_array($query);

 

foreach($array as $a){

 

  // something like

  // if $a['date_added'] put in today before 4pm display label else tomorrow it should display

  $label = 'New client';

 

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/123483-date-and-time-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.