Highly experienced and skilled on Software Architecture (PHP, MySQL, JavaScript, jQuery, Ajax, XML, API Services), Server and Software Security, Project Management combined with Online Marketing & Internet Advertising background. I am a "Problem Solver" who only focuses on "Results". Leaded/worked on 500+ Web/Software/Marketing Projects about Web, E-Commerce, ERP, CRM, CMS, B2B, B2C, XML, API, Online Flight & Hotel Reservation Systems almost from every industry until today.

Contact Info


Dubai / United Arab Emirates

MySQL Datediff (Date Difference Calculation)

To calculate numbers of days between two colums, MySQL has Datediff function for calculation between two dates.

Example Usage:

SELECT DATEDIFF (NOW (), date) as ExampleDate FROM Calendar;

This query will check Today's Date by Now() function of MySQL and calculate days from "Example" date until today.

Datediff Usage is not well-known by communities and many people are doing these calculations with additional requirements. 

Using this query can save "PHP" side codings by solving them on "Query Stage" without requiring to be proceed from raw.

Share this post:

Contact Form

Share about your ideas or projects, just fill form below and I'll get back to you asap.

Type security code on the box for verification.