php_begins Posted February 3, 2012 Share Posted February 3, 2012 I am writing code in the ZEND framework and i need to get the current day in like 2012-02-03: In the controller: $time=date('YYYY-mm-dd',time()); $this->view->time=$time; In view: <?php echo $this->time; ?> Output: 2012201220122012-0202-0303 I dont know why it is displaying like that instead of once...there is no loop anywhere. Quote Link to comment https://forums.phpfreaks.com/topic/256335-current-date-displaying-incorrectly/ Share on other sites More sharing options...
SergeiSS Posted February 3, 2012 Share Posted February 3, 2012 Read help more careful!!! This is correct code: $time=date('Y-m-d',time()); Quote Link to comment https://forums.phpfreaks.com/topic/256335-current-date-displaying-incorrectly/#findComment-1314086 Share on other sites More sharing options...
php_begins Posted February 3, 2012 Author Share Posted February 3, 2012 Damn ..Thanks Quote Link to comment https://forums.phpfreaks.com/topic/256335-current-date-displaying-incorrectly/#findComment-1314105 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.