Results 1 to 7 of 7

Thread: Date Format

  1. #1
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Date Format

    Even though the general settings for my site have the date format set as custom d/m/Y, the format of the "posted" date on the theme still appears in m/d/Y (here in New Zealand we don't use that)..I tried the other options, but it always stays the same. Is there somewhere else I need to change this or is it part of the theme? Thanks.

    http://www.kidsgearnz.com/Classifieds/

  2. #2
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Date Format

    Well, tell New Zealand they need to change. j/k

    Edit the functions.php file and search for "function classi_time". The line right below that controls how the date/time will display.

  3. #3
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Re: Date Format

    :P

    Well I edited it from:
    Code:
    $t_time = get_the_time(__('Y/m/d g:i:s A'));
    to:
    Code:
    $t_time = get_the_time(__('Y/d/m g:i:s A'));
    also tried:
    Code:
    $t_time = get_the_time(__('d/m/Y g:i:s A'));
    but the date is still showing as incorrect (your way )...Is there anything else I need to check/change?

  4. #4
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Date Format

    My mistake. Change that line back to the original code and edit the line a couple below that.

    Code:
    $h_time = mysql2date(__('n/j/Y'), $m_time);

  5. #5
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Re: Date Format

    Thank you

    Sorry to be a pain, BUT it has changed the posted date in the gallery view, but I notice when I open an actual ad, the date is still in the previous format..is this somewhere else?

  6. #6
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: Date Format

    If you want to change it on the ad page itself, then you'll need to edit single.php. Do a search for the following and update that bit of code to your date preference:

    Code:
    the_time('n/j/Y \@ g:ia')

  7. #7
    pepsi's Avatar
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    14,883
    Thanks
    91
    Thanked 804 Times in 718 Posts

    Re: Date Format

    Done! Thanks for the help. Promise I won't bug you for at least another 1 day

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)