Joomla.it Forum

Componenti per Joomla! => Gestione e-commerce => : Fenicexx 14 Jan 2013, 15:18:57

: VirtueMart: timezone
: 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.
: Re:VirtueMart: timezone
: Fenicexx 17 Jan 2013, 11:25:47
Ho provato a:
:
$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.