Location: PHPKode > projects > Snort Log Monitor and Ticketing System > snortlogmonitor/mytime.php
<?php
$fromyearP=str_pad($fromyear,4, "0", STR_PAD_LEFT);
$frommonthP=str_pad($frommonth,2, "0", STR_PAD_LEFT);
$fromdayP=str_pad($fromday,2, "0", STR_PAD_LEFT);
$fromhourP=str_pad($fromhour,2, "0", STR_PAD_LEFT);
$fromminuteP=str_pad($fromminute,2, "0", STR_PAD_LEFT);
$fromsecondP=str_pad($fromsecond,2, "0", STR_PAD_LEFT);
$toyearP=str_pad($toyear,4, "0", STR_PAD_LEFT);
$tomonthP=str_pad($tomonth,2, "0", STR_PAD_LEFT);
$todayP=str_pad($today,2, "0", STR_PAD_LEFT);
$tohourP=str_pad($tohour,2, "0", STR_PAD_LEFT);
$tominuteP=str_pad($tominute,2, "0", STR_PAD_LEFT);
$tosecondP=str_pad($tosecond,2, "0", STR_PAD_LEFT);

$FromTime = $fromhourP.$fromminuteP.$fromsecondP;
$FromDate = $fromyearP.$frommonthP.$fromdayP;
$ToTime =  $tohourP.$tominuteP.$tosecondP;
$ToDate =  $toyearP.$tomonthP.$todayP;

$FromDateTime = $FromDate.$FromTime;
$ToDateTime = $ToDate.$ToTime;

$FromDateTime = doubleval($FromDateTime);
$ToDateTime = doubleval($ToDateTime);


#-- Get current Date & Time ----
  $now=getdate(time());
  $year=str_pad($now["year"], 4, "0", STR_PAD_LEFT);
  $month=str_pad($now["mon"], 2, "0", STR_PAD_LEFT);
  $day=str_pad($now["mday"], 2, "0", STR_PAD_LEFT);
  $hour=str_pad($now["hours"], 2, "0", STR_PAD_LEFT);
  $minute=str_pad($now["minutes"], 2, "0", STR_PAD_LEFT);
  $second=str_pad($now["seconds"], 2, "0", STR_PAD_LEFT);
  $CurrentDate=$year."-".$month."-".$day;
  $CurrentTime=$hour.":".$minute.":".$second;
  $CurrentDateTime=$CurrentDate.$CurrentTime;
  $intCurrentDateTime=$year.$month.$day.$hour.$minute.$second;
?>
Return current item: Snort Log Monitor and Ticketing System