Safwen Posted August 27, 2013 Share Posted August 27, 2013 Hi guys, i would like to add 1 year to a dynamic date value in smarty. i explain to add 1 year to the current date i use and worked well : {"+1 year"|date_format:'%Y-%m-%d'} now how to do that with a date value {$account.date_add} other thing how to do a difference between 2 dates in days. thank you in advance. Link to comment Share on other sites More sharing options...
Safwen Posted August 27, 2013 Author Share Posted August 27, 2013 i have solved it with PHP and worked well like this : $plusoneyear = date("Y-m-d", strtotime(date("Y-m-d", strtotime($this->context->customer->date_add)) . " + 365 day")); $this->context->smarty->assign('one',$plusoneyear); but i would like to know how to do it in smarty ? Link to comment Share on other sites More sharing options...
Nickovitshj Posted July 19, 2021 Share Posted July 19, 2021 Did you ever find this solution Safwen? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now