Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Display UK date format
  • Hi Guys! What do I need to change in the date.php config file to change the date format to be UK? Is there any other config files I need to change as well? I tried adding
               'uk'          => '%d/%m/%Y',
      'uk_short' => '%m/%d',
      'uk_named' => '%B %d %Y',
      'uk_full'         => '%I:%M %p, %B %d %Y',
    

    I'm doing this
    echo \Date::factory($subscription->expiry_date)->format();?>
    

    and the date is displayed as 07/21/04 19:07:13 I just want display the date as 21/07/04 without the time. Many thanks.
  • Seems you found something of a bug, still this would work: \Date::factory($subscription->expiry_date)->format('uk'); I just fixed it: To change the default timezone you have to change the pattern for the 'local' key, this is the default that's used when no pattern or named pattern was given to Date::format().
  • Jelmer Schreuder wrote on Tuesday 19th of July 2011:
    Seems you found something of a bug, still this would work: \Date::factory($subscription->expiry_date)->format('uk'); I just fixed it: To change the default timezone you have to change the pattern for the 'local' key, this is the default that's used when no pattern or named pattern was given to Date::format().

    Changed the local pattern and its working now. Thanks.
  • Hi Huzzi,

    i have the same issue for french dates. My 'locale' is set to  '%c' and timerzone to Europe/Paris.

    And one last thing, the docs are short on text name months as jan, fev, etc ... only numbers. 
    Have you a code like %x for literal mounts names ?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion