Order by Question |
On my database column date_created_on the date and time is in php time() as shown in image below
Just need to make sure that even though my date_created_on gets inserted with time() that it still can sort it out by date. On my end I see no problems. When view list PHP Code: public function getQuestions() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Yep should be fine. Though I'd recommend not using timestamps anymore. DateTime is more future proof
Not to mention more readable when looking at your data.
(04-04-2017, 12:34 AM)JayAdra Wrote: Yep should be fine. Though I'd recommend not using timestamps anymore. DateTime is more future proof Thank you for that info. if i use DateTime would I need to change the type int(10) Also do you have link for the DateTime so can read php manual.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Here are the docs:
http://php.net/manual/en/class.datetime.php Yes you'd need to change the type to datetime. Keep in mind you may need to consider timezones, and if the user's timezone will vary. If using datetime, be sure to store all data in UTC timezone, and then on output convert to local time.
(04-04-2017, 03:23 AM)JayAdra Wrote: Here are the docs: Thank you.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Another thing I would rename your datetime fields. The new CI4 will be using ( created_at and updated_at )
fields in it's new model class. Will save you time later if you need to convert to a CI4 app structure. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |