Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Age of Ticket in Days

I am trying to install  a column that displays the Age of the Tickets in days
These links have helped to inform but they do not work with the date difference as in : Date of opening ticket and the Now time
http://www.sudobash.net/osticket-age-of-tickets
http://osticket.com/forum/discussion/80498/append-a-created-ticket-status-form-field-to-an-already-existing-column-in-the-main-ticket-view#latest

Osticket Version v1.9.6
MySql    Version 5.5.54
In "tickets.inc.php" I have made progress using  "strtotime" but I get an error with the "date",

The 'date' returns a value of  
-7200 .           ( Not returning the correct value. )
The Now Returns a value of  1489269600    ( current date increasing with time )

Basically  this is what I have done so far
around line 250 I have added

$sqldate = ('date');                                   
$newdate = date('Y-m-d',strtotime($sqldate));
echo $newdate;

$sqldate2 = ('today UTC');
$newdate2 = date('Y-m-d',strtotime($sqldate2));
echo $newdate2;

$timeopen  = (strtotime($newdate))     ;
$age_date  = (strtotime($newdate2))   ;

Then around line 500 (this is dynamic as I have a lot of construction text at present )  I simply subtracted them.

<td align="center" nowrap><?php echo ((($age_date) - ($timeopen ))/ 86400  ) ; ?></td>

Apparently
strtotime does not have a problem with USA and European dates ,
I quote :
' Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.'

 
Can anybody help in moving this forward ?

All help will be MOST graciously appreciated

thanks
Andy

Comments

  • I do not know anyone who is running such an old version of osTicket so I don't think that you will get much of a community response.
Sign In or Register to comment.