I have a page using unix timestamps to calculate a start/finish time for a worker, however I just noticed today (UK Daylight savings time changed last night) that when I chose a date from last week then the times are all -1 hour from the correct time.
I am sure this must mean that the DST setting is using the current DST setting rather than the actual setting for the chosen date. I have been hunting but couldn't find a way to sort it.
How can I make the report output the correct time for that day?
The code pertaining to the date or time is posted below.
Thanks for any help.
Gordon
$startdate1 = "-1";
if (isset($POST['date1'])) {
$startdate1 = (get_magic_quotes_gpc()) ? $POST['date1'] : addslashes($_POST['date1']);
}
$shiftstart = $row_Recordset2['mintime'];
$shiftend = $row_Recordset3['maxtime'];
select Event, Alias, Min(Date_Time) as mintime FROM vehiclestate WHERE Vehicle_ID = %s and Date_Time between Unix_Timestamp(%s) and (Unix_Timestamp(%s)+86399) and Event = 108", GetSQLValueString($colname1_Recordset2, "text"), GetSQLValueString($colname2_Recordset2, "text"), GetSQLValueString($colname3_Recordset2, "text"));
Shift started at <?php echo date("H:i", $shiftstart); ?> and finished at <?php echo date("H:i", $shiftend); ?><br>