Adjusting webservices to use ctime, mtime syntax
Bug #1394359 reported by
Robert Lyon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
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
tags: | added: webservices |
Changed in mahara: | |
importance: | Undecided → High |
assignee: | nobody → Robert Lyon (robertl-9) |
milestone: | none → 15.04.0 |
status: | New → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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.