date() assistance...

  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 5th, 2009, 8:30 am

Yep, check the post I just made - I had an error in my code, but the newer post has been tested.
I'd love to change the world, but they won't give me the source code.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 5th, 2009, 8:30 am

  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 5th, 2009, 8:32 am

sorry i posted the above before refreshing my browser, otherwise can you stick to this date format M d, Y please.
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Joined: Jul 25, 2005
  • Posts: 2735
  • Loc: Nashville, TN
  • Status: Offline

Post June 5th, 2009, 8:34 am

I think you can figure out how to plug in your own format. I don't mind assisting, but if you're just looking for someone to write the code for you and you're not willing to learn it, that I can't help you anymore.
I'd love to change the world, but they won't give me the source code.
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 5th, 2009, 8:35 am

Assuming we have these dates in mysql already in this formt then we ask a user to pick a date for his current savings and then we show the current plus last wednesday's savings. thats what am tryin...
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 5th, 2009, 8:37 am

sure i can do the code convertion but i thot the example was strickly for the format you gave! if it's flexible then let me give it a shot. thanks a lot anyway , Master
  • tiffix
  • Student
  • Student
  • User avatar
  • Joined: Jun 03, 2009
  • Posts: 65
  • Loc: kenya
  • Status: Offline

Post June 5th, 2009, 8:43 am

Men You Rock UPsGuy. It Worked well as i Wanted. i really appreciate you support

here's my code courtesy of you:

Code: [ Select ]
$myDate = date("M d, Y", strtotime("May 18, 2009"));
 
    do {
         $myDate = strtotime('-1 day' ,strtotime($myDate));
         $myDate = date('M d, Y', $myDate );
    }while(date("w", strtotime($myDate)) != '3');
     
    echo date("M d, Y", strtotime($myDate))."</br>";
    //echo date("w", strtotime($myDate))."</br>";
 
  1. $myDate = date("M d, Y", strtotime("May 18, 2009"));
  2.  
  3.     do {
  4.          $myDate = strtotime('-1 day' ,strtotime($myDate));
  5.          $myDate = date('M d, Y', $myDate );
  6.     }while(date("w", strtotime($myDate)) != '3');
  7.      
  8.     echo date("M d, Y", strtotime($myDate))."</br>";
  9.     //echo date("w", strtotime($myDate))."</br>";
  10.  



Thanks :D

Post Information

  • Total Posts in this topic: 21 posts
  • Users browsing this forum: No registered users and 176 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.