Thread: Date Format

Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Location
    Sydney Australia
    Posts
    829
    Plugin Contributions
    0

    Default Date Format

    Hi All,

    Need to know how to change (What Files) the date format from US to UK format (for the whole site) in version 1.5.8A zencart please.

    Server Information:
    Server Host: outdoorking.com (172.105.167.154)
    Database: outdoorking_xxxx
    Home: /home/xxx/public_html/xxx/Server OS: Linux 3.10.0-1062.12.1.el7.x86_64
    Server Date: 31/10/2023 09:16:50
    Server Up Time: Disabled/UnavailableHTTP
    Server: ApachePHP Version: 7.3.33 (Zend: 3.3.33)PHP File
    Uploads: OnUpload Max Size: 1024M
    PHP Memory Limit: 1024M
    POST Max Size: 1024M
    Database Engine: MySQL 5.7.44
    Database Host: localhost (127.0.0.1)
    Database Date: 31/10/2023 09:16:50
    Database Data Size: 244,309 kBDatabase
    Index Size: 41,430 kBMySQL Slow Query Log
    Status: OffMySQL Slow Query
    Log File: /var/lib/mysql/au-slow.logMySQL Mode: NO_ENGINE_SUBSTITUTION
    Outdoorking
    Live Site www.outdoorking.com.au

  2. #2
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    407
    Plugin Contributions
    6

    Default Re: Date Format

    Try the following for Australia
    file: admin /includes/languages/lang.english.php
    Code:
    add 1st line
    @setlocale(LC_TIME, ['en_AU', 'en_AU.utf8mb4', 'en', 'English_Australia.1252']);
    
    change
    'DATE_FORMAT' => 'd/m/Y',  /* from 'DATE_FORMAT' => 'm/d/Y', */
    
    'DATE_FORMAT_SHORT' => '%d/%m/%Y', /* from 'DATE_FORMAT_SHORT' => '%m/%d/%Y', */
     
    'DATE_FORMAT_SPIFFYCAL' => 'dd/MM/yyyy', /* from 'DATE_FORMAT_SPIFFYCAL' => 'MM/dd/yyyy', */
    
    'ENTRY_DATE_OF_BIRTH_ERROR' => '&nbsp;<span class="errorText">(eg. 21/05/1970)</span>', // from 'ENTRY_DATE_OF_BIRTH_ERROR' => '&nbsp;<span class="errorText">(eg. 05/21/1970)</span>',
    
    'PHP_DATE_TIME_FORMAT' => 'd/m/Y H:i:s', // from 'PHP_DATE_TIME_FORMAT' => 'm/d/Y H:i:s',
    file: /includes/languages/lang.english.php

    Code:
    as first line of code
    global $locales;
    $locales = ['en_AU', 'en_AU.utf8mb4', 'en', 'English_Australia.1252']; // from $locales = ['en_US', 'en_US.utf8', 'en', 'English_United States.1252'];
    @setlocale(LC_TIME, $locales);
    
    change
    
    'DOB_FORMAT_STRING' => 'dd/mm/yyyy',  // from 'DOB_FORMAT_STRING' => 'mm/dd/yyyy', 
    
    'ENTRY_DATE_OF_BIRTH_ERROR' => 'Is your birth date correct? Our system requires the date in this format: DD/MM/YYYY (eg 21/05/1970) or this format: YYYY-MM-DD (eg 1970-05-21)', // from 'ENTRY_DATE_OF_BIRTH_ERROR' => 'Is your birth date correct? Our system requires the date in this format: MM/DD/YYYY (eg 05/21/1970) or this format: YYYY-MM-DD (eg 1970-05-21)',
    
    'ENTRY_DATE_OF_BIRTH_TEXT' => '* (eg. 21/05/1970 or 1970-05-21)', // from 'ENTRY_DATE_OF_BIRTH_TEXT' => '* (eg. 05/21/1970 or 1970-05-21)',
    file: /includes/extra_configures/set_time_zone.php

    Code:
    $TZ = time zone = 'Australia/Brisbane';  // change to your location eg 'Australia/Sydney'
    OldNGrey
    ZC222 PHP 8.4.16
    MySQL 11.8.5-MariaDB

 

 

Similar Threads

  1. Replies: 4
    Last Post: 1 Apr 2021, 10:30 PM
  2. Date format
    By TRGames in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Mar 2010, 10:18 PM
  3. Date Format
    By uniqueliving in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Feb 2010, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg