Open-AudIT
https://www.open-audit.org/phpBB3/

How does OA format time for certain table data?
https://www.open-audit.org/phpBB3/viewtopic.php?f=5&t=2887
Page 1 of 1

Author:  jhurd8025 [ Wed Jul 16, 2008 9:25 am ]
Post subject:  How does OA format time for certain table data?

I figure this is done within the PHP code somewhere.

Say for system_last_boot or even last_audit

the data is put into the database as YYYYMMDDHHMMSS
but then durning the query screens it comes out as:
2008-05-02 14:05


I put in the database some cutom data as YYYYMMDDHHMMSS and I want the PHP code to do the same formatting but dont know where to look.

Thanks

Author:  Chad [ Fri Jul 18, 2008 12:19 am ]
Post subject:  Re: How does OA format time for certain table data?

I would be interested in knowing too. I've made a quick and easy form for manually entering other devices but I cannot seem to get the timestamp format correct so that it displays properly when you view other items in OA.

I just briefly tried to look at how OA does it, and it looks lilke the time stamp is generated from the following lines in the audit.vbs file...

dim dt : dt = Now()
timestamp = Year(dt) & Right("0" & Month(dt),2) & Right("0" & Day(dt),2) & Right("0" & Hour(dt),2) & Right("0" & Minute(dt),2) & Right("0" & Second(dt),2)

Then it looks like the timestamp is then entered by doing a trim from like...

$timestamp = trim($extended[2]);

Then it is inserted into the database from that $timestamp variable with a mysql query.

I'm guessing some variation of the now() function in mysql could generate the correct timestamp format that OA is looking for, I'm just not sure exactly how it is done.

Author:  ef [ Fri Jul 18, 2008 12:36 am ]
Post subject:  Re: How does OA format time for certain table data?

You don't need to modify audit.vbs, just add your custom field(s) to the function "special_field_converting" in include_functions.php (return_date or return_date_time as needed)

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/