• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Date Format

#1
[eluser]Kemik[/eluser]
Hey,

Say if I'm using date and time a lot in my application, subtracting, adding and comparing them, which format would you recommend? Unix or MySQL?

Thanks. To give you an idea it's for a calendar and todo list. E.g. x days to complete y. Find tasks between x and y dates.

#2
[eluser]xwero[/eluser]
If you plan to do the actions in sql statements i think it's best to choose the mysql format. If you plan to do the actions in php it's best to choose unix.

I would go for the mysql format and keep the actions as close to the data as possible.

#3
[eluser]Sean Murphy[/eluser]
For now I store dates in a DATETIME field in MySQL and use unix timestamps in my application. I have nifty functions in my models that transparently do the conversion for me.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.