[SOLVED] How to change the time notation in the 'update'

Rate this topic: Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.Evaluations: 2, 3.50 on the average.3.50 out of 6 based on 2 vote(s)
GK User
Mon Sep 21, 2015 9:50 am
Reply with quote
Report this post
Good morning,

How can I change the time notation in the 'Update' field from AM/PM to 24H?

Thanks in advantage,

best regards,

Volkmar de Vries
User avatar
Fresh Boarder

GK User
Wed Sep 23, 2015 10:20 pm
Reply with quote
Report this post
Hi,

You need only change Date Format in Translation file.
language\en-GB\en-GB.tpl_gk_news2.ini

Search the line 14 (TPL_GK_LANG_UPDATE_DATE_FORMAT="g:i A T, M j, Y")
and change to:
TPL_GK_LANG_UPDATE_DATE_FORMAT="G:i A T, M j, Y"

You can change full format, changing positions and uppercase!

* I have problem with time location. This block only show UTC....
Im from Brazil and need change to "São Paulo"
:(
User avatar
Fresh Boarder

GK User
Wed Sep 23, 2015 10:49 pm
Reply with quote
Report this post
Solved!

I added time zone on php file in template directory.
templates\gk_news2\layouts\blocks\updates.php

Insert before echo:
Code: Select all
date_default_timezone_set('America/Sao_Paulo');
echo JText::_('TPL_GK_LANG_UPDATE_DATE') . ' ' . date(JText::_('TPL_GK_LANG_UPDATE_DATE_FORMAT'), $final_date);
User avatar
Fresh Boarder

GK User
Wed Oct 12, 2016 12:27 am
Reply with quote
Report this post
Do I have to add these lines after <?php at the top of the code? What about the rest? Should I delete it? What can I do to change the timezone to Europe / Berlin ?

The code starts with:
<?php
// No direct access.
defined('_JEXEC') or die;
// Used helper function
if(!function_exists('gk_get_last_update')) {
function gk_get_last_update($t

....and so on... etc...
User avatar
Junior Boarder


cron