0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Help with a bit of PHP

  • Help with a bit of PHP

    Posted 13 years 8 months ago
    • Hi all,

      Any chance of a hand with a bit of PHP that I am struggling with?

      I am using the AEC extention for Joomla which stores the start and expiry date of site members in a datetime format in MySQL.

      I am able to get the dates from the database through a function but it prints it like this:
      2011-09-20 19:10:50

      I would like it like this though:
      20 September 2011

      The bit of code that gets the info is as follows:
       
      <?php
      echo JText::_('MEM_SIGNUP') . $subscription->signup_date;  //Membership Start Date ?><br>
       
      I am just not sure where to put the php formatting stuff.

      Any help much appreciated.

      Chris
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Help with a bit of PHP

    Posted 13 years 8 months ago
    • Havent tested it but try...
      <?php
      $date = $subscription->signup_date;
      echo JText::_('MEM_SIGNUP') . date("d F Y", $date);  //Membership Start Date 
       
      ?>
      <br>

      Ad.
    • Kiss my RSS
  • Re: Help with a bit of PHP

    Posted 13 years 8 months ago
    • Cheers Ad,

      That did not work what i ended up with was a date of 1 January 1970 (PHP Starting date??).

      This is really starting to bug me now as i know it is possible just do not know how to achieve it.

      Any other thoughts?

      CHRIS
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Help with a bit of PHP

    Posted 13 years 8 months ago
    • Hmm ok, it was picking up the date as a text field not a date.
      Try this...
       
      <?php
      echo JText::_('MEM_SIGNUP') . date("d F Y", strtotime($subscription->signup_date));
      ?>
      <br>
       
    • Kiss my RSS
  • Re: Help with a bit of PHP

    Posted 13 years 8 months ago
    • Hi Ad,

      Thanks so much you are a genius!!

      CHRIS
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Help with a bit of PHP

    Posted 13 years 8 months ago
    • No worries mate. :mrgreen:
    • Kiss my RSS

Time to create page: 0.062 seconds