Skip to main content
Dileep_NR
Inspiring
March 18, 2009
Question

Mysql- Date Function

  • March 18, 2009
  • 1 reply
  • 844 views
In mysql should we need to convert dates into a common format while using date functions?
eg:-DATE_ADD(paysub.paymentUpdatedon, INTERVAL 1 MONTH)
DATEDIFF(current_date(),(DATE_ADD(paysub.paymentUpdatedon, INTERVAL 1 MONTH)))
from paymentsubscription paysub;
This topic has been closed for replies.

1 reply

Inspiring
March 18, 2009
if your dates are stored as dates (date objects) then you do not need to
format them in any way to use them in mysql's date functions.
if your dates are stored as text strings - bad you! - then you need to
convert them into dates explicitly.


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Dileep_NR
Dileep_NRAuthor
Inspiring
March 18, 2009
Hi,

The "paymentUpdatedon" filed is a "datetime" type.

That means i dont worry about the the formats of date...

Thansks