date difference | WordPress.org

[ad_1]

Hello,

I am trying to calculate the date difference. I am using the formula DATEDIFF(NOW(), fieldname1, ‘dd-mm-yyyy’, ‘y’)[‘years’]

The result I am getting is only in years. Is it possible to show years, months, and days.

For example if I enter the date in fieldname as 01/04/2023, I should get the output as ‘1 year 0 months 2 days’

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer