Adjusting webservices to use ctime, mtime syntax

Bug #1394359 reported by Robert Lyon on 2014-11-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Robert Lyon

Bug Description

Currently webservices uses 'timecreated' and 'timemodified' columns in the 'external_services' db table which are type INT

 - It would be better to alter them to be 'ctime' and 'mtime' and be type DATETIME - so as to be consistent with the other db tables in mahara.

But this will mean converting the unix timestamp to datetime before saving to db and back again when extracting from db

Aaron Wells (u-aaronw) wrote :

Converting a Unix timestamp to a datetime and back again is what we do every time we store a date in the database. ;)

There are functions for the conversion in dml.php:

1. db_format_timestamp($timestamp): Converts from a Unix timestamp into the datetime format suitable to insert into the DB.

2. db_format_tsfield($field): Generates the SQL to convert the database field from a datetime into a Unix timestamp.

Robert Lyon (robertl-9) on 2014-11-27
tags: added: webservices
Robert Lyon (robertl-9) on 2014-12-09
Changed in mahara:
importance: Undecided → High
assignee: nobody → Robert Lyon (robertl-9)
milestone: none → 15.04.0
status: New → In Progress

Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit ac78d056462478f4a10ce515b49b1ce14cea613b
Author: Robert Lyon <email address hidden>
Date: Fri Dec 12 14:16:35 2014 +1300

Adjusting webservices to use ctime/mtime syntax (Bug #1394359)

To be more in keeping with existing codebase.

Change-Id: Iaa850c7cfc609afee0dd014bef6d2a2673c7a25f
Signed-off-by: Robert Lyon <email address hidden>

Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9) on 2015-04-17
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers