cunoodle2 Posted February 3, 2009 Share Posted February 3, 2009 I'm just curious as to which would use less resources/cpu processing? In the past I've always just used the unix epoch integer and then used date() in php to format the output. I'm working on a high volume website and looking to trim all resources as slim as possible for fast processing and am just curious. In either case I need to do some form of processing to either convert the epoch using to date() to the proper output or convert the way that MySQL stores the data ("‘YYYY-MM-DD HH:MM:SS’ ") to the proper output to the screen. Any input/discussion would be much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/143682-store-date-as-int-or-as-datetime-in-mysql/ Share on other sites More sharing options...
trq Posted February 3, 2009 Share Posted February 3, 2009 Storing the data is a timestamp will allow you to process it using mysql's date / tile functions. You can also do all your formatting in your queries. Quote Link to comment https://forums.phpfreaks.com/topic/143682-store-date-as-int-or-as-datetime-in-mysql/#findComment-753907 Share on other sites More sharing options...
cunoodle2 Posted February 3, 2009 Author Share Posted February 3, 2009 Which is faster and using less resources? Converting from the epoch INT to date() or converting the output in the mysql query? Mods: Does anyone know what phpfreaks does for timestamp processing??? Quote Link to comment https://forums.phpfreaks.com/topic/143682-store-date-as-int-or-as-datetime-in-mysql/#findComment-753920 Share on other sites More sharing options...
fenway Posted February 6, 2009 Share Posted February 6, 2009 Storing the data is a timestamp will allow you to process it using mysql's date / tile functions. You can also do all your formatting in your queries. Not sure why you chose TIMESTAMP instead of DATETIME... TIMESTAMP has all sorts of buggy unexpected "features". Which is faster and using less resources? Converting from the epoch INT to date() or converting the output in the mysql query? Mods: Does anyone know what phpfreaks does for timestamp processing??? Huh? Why are you converting? Quote Link to comment https://forums.phpfreaks.com/topic/143682-store-date-as-int-or-as-datetime-in-mysql/#findComment-755793 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.