Archive

Posts Tagged ‘Programming Facts Blog’

How to get number of days between two dates using MySQL

While developing web application , in many many places we face the problem where we can use only MYSQL and get the number of number of days between two given dates using MySQL. Syntax – DATEDIFF(FirstDate,SecondDate) This function will calculate the difference bretween two dates and give the out put in number of days. It will give the result positive only if first date is grater than second date. If Second date is greater than First date than it will give the negative result.

Example: Query : SELECT DATEDIFF(‘2010-01-05’, ‘2009-12-15’); Result : 21 Query : SELECT DATEDIFF(‘2009-12-15’, ‘2010-01-05’); Result : -21 hope this will  help full for some. 😀 let me know if any solution require !
Categories: Androide developer, ASP, asp.net, CakePHP Developer India, Flash Designer, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, freelance web, freelance web designer, Freelance web developer, get a freelancer, Graphic Designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, Hire Web Developer India, India, india web development, Indian Freelancer, ipad, iphone application developer, iphone developer, iphone website designer, java, JavaScript, joomla, joomla customization india, Joomla Developer, joomla developer india, Media, mysql, oscommerce Customization, oscommerce developer, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, PHP Programmer India, Php programming, PHP Web Development, php web programmer, Programming Facts Blog, reelance SEO and PPC Consultant, web design india, web designer, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, Web development India, wordpress, Wordpress Blog Developer, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
%d bloggers like this: