Yii Framework Forum: Repost:::auto-Calculate The Date - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Repost:::auto-Calculate The Date

#1 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 23 February 2014 - 12:00 AM

hi guys...

i'm having a problem to auto-calculate the date...
i mean,how to calculate the day between date?

for example; Jan 26th until Jan 30th = 5 days...

i already try this method, but it still doesn't calculate it... :-[

<?php
      $date_start = new DateTime('');
      $date_end= new DateTime('');                   
      echo $duration = $date_start->diff($date_end)->days;      
?>


i refered from THIS and also THIS.

i hope anyone can help me to solve this problem...
thank you... :)
0

#2 User is offline   Matthew Torres 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 12-February 14

Posted 24 February 2014 - 08:50 PM

You should not repost your topic just because you nobody answered the previous topic. Anyway. Have you tried implementing TIMESTAMP in your application. If not you can look into these tutorials:
http://www.tizag.com/phpT/phpdate.php
http://www.tareeinte...n-tutorial.html
0

#3 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 25 February 2014 - 03:39 AM

View PostMatthew Torres, on 24 February 2014 - 08:50 PM, said:

You should not repost your topic just because you nobody answered the previous topic. Anyway. Have you tried implementing TIMESTAMP in your application. If not you can look into these tutorials:
http://www.tizag.com/phpT/phpdate.php
http://www.tareeinte...n-tutorial.html


i'm sorry for repost my topic and asked the same stupid question... :(
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users