Joomla.it Forum
Componenti per Joomla! => Gestione e-commerce => : Fenicexx 14 Jan 2013, 15:18:57
-
Salve,
non so se scrivo nella sezione giusta. Chiedo ai moderatori di spostare eventualmente fosse sbagliata.
Uso Joomla 2.5.8 e vm 2.0.18.
Ho bisogno di ricevere come informazione dal database la data e l'ora di inserimento di un prodotto.
Una volta individuata la tabella e il record che mi serve ho notato che l'orario è un'ora indietro.
Ho impostato il timezone del sistema nel fuso orario giusto e il mio hosting è ********.
Qualche idea?
edit by jk: cortesemente rispettare il regolamento che vieta di citare prodotti/servizi a pagamento.
-
Ho provato a:
- cambiare fuso orario dalla configurazione globale inserendo quella di Atene che è un'ora avanti (non serviva a niente,ma volevo fare qualche prova), il risultato non è cambiato.
- ho spulciato un po' i file php e penso che il problema stia in:
$intervals = JRequest::getWord ('intervals', 'day');
switch ($intervals) {
case 'day':
$this->intervals = 'DATE( o.created_on )';
break;
case 'week':
/$this->intervals = 'WEEK( o.created_on )';
break;
case 'month':
$this->intervals = 'MONTH( o.created_on )';
break;
case 'year':
$this->intervals = 'YEAR( o.created_on )';
break;
default:
// invidual grouping
$this->intervals = 'o.created_on';
break;
}
girando un po' sul web ho visto che (forse) in precedenti versioni quella porzione di codice era:
switch ($intervals) {
case 'day':
- $this->intervals = 'DATE( o.created_on )';
+ $this->intervals = 'DATE( convert_tz(o.created_on, "UTC", "'.$this->tzoffset.'") )';
break;
case 'week':
- $this->intervals = 'WEEK( o.created_on )';
+ $this->intervals = 'WEEK( convert_tz(o.created_on, "UTC", "'.$this->tzoffset.'") )';
break;
case 'month':
- $this->intervals = 'MONTH( o.created_on )';
+ $this->intervals = 'MONTH( convert_tz(o.created_on, "UTC", "'.$this->tzoffset.'") )';
break;
case 'year':
- $this->intervals = 'YEAR( o.created_on )';
+ $this->intervals = 'YEAR( convert_tz(o.created_on, "UTC", "'.$this->tzoffset.'") )';
break;
default:
// invidual grouping
- $this->intervals = 'o.created_on';
+ $this->intervals = 'convert_tz(o.created_on, "UTC", "'.$this->tzoffset.'")';
break;
}
Non so se sto focalizzando l'attenzione sulla parte giusta, ho iniziato da poco a studiare php.