⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Most elegant way of using a date/time field



voghDev

voghDev
  • profile picture
  • Member

Posted 23 July 2014 - 13:41 PM

Hi,

 

i'm using GroceryCrud with a MySQL 5 DB. Am quite happy with it. My question is which is the most elegant and comfortable way of managing a DATE/TIME field inside a table. I would like to declare it a epoch integer, storing seconds passed since 1970/1/1 00:00, although this is not mandatory.

 

Which solution did work best for you?

- Which datatype does the MySQL field have

- Which functions to use inside GroceryCRUD's controller and model to make it easy and usable

 

Thanks in advance guys :)

 

 

[EDIT] i've seen solutions like this one, but i would prefer not to modify GroceryCRUD's core, rather than leaving it as it is.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 24 July 2014 - 07:40 AM

Well the better way around - if you dont want to alter the core is a callback.