News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Wrong date and times on orders

Started by billo007, December 08, 2017, 18:36:42 PM

Previous topic - Next topic

billo007

Virtuemart 3.2.8 joomla 3.8.2 all of a sudden time is wrong on orders about 3 hours off. Checked time zone in joomla and server and they are both correct any ideas what could of caused it?

Jörgen

Hello If i remember correctly virtuemart does not store servertime it stores universal timezone. This is not adjusted for printout.
Regards
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

jenkinhill

Quote from: Jörgen on December 10, 2017, 14:17:38 PM
Hello If i remember correctly virtuemart does not store servertime it stores universal timezone.

And was eloquently described in https://forum.virtuemart.net/index.php?topic=134222.0
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Mike J

Hi billo007,

After updating to Virtuemart 3.2.8 / Joomla 3.8.2 my order times are now also out (1 of these 2 updates responsible).

As Virtuemart does not store servertime I take it that Joomla is the culprit... Did you find a solution?

If so could you share?
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

Milbo

#4
Virtuemart should always store in GMT. But there is a bug in vmjsapi.php around line 878 function "date".

just add a "false" as new parameter to the JHtml functions. For example
Quote
$formatedDate = JHtml::_('date', $date, vmText::_('DATE_FORMAT_'.$format));
to
Quote
$formatedDate = JHtml::_('date', $date, vmText::_('DATE_FORMAT_'.$format),false);
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Mike J

Many thanks Milbo,

That sorted mine out. Muchly appreciated.

For others:

administrator/components/com_virtuemart/helpers/vmjsapi.php

Line 884 (changed 'null' to 'true') as per:

Quote$formatedDate = JHtml::_('date', $date, vmText::_('DATE_FORMAT_'.$format),null);

to:

Quote$formatedDate = JHtml::_('date', $date, vmText::_('DATE_FORMAT_'.$format),true);
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39

billo007


Milbo

I am sorry, it is false (I corrected my post). True takes the timezone of the user. false takes the time of timezone of the shop. But okey, most time, it makes no difference if you use true or false
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Mike J

Ok, nice to know. Many thanks... Awesome work as always!
VirtueMart 4.0.2 10661
Joomla! ‎3.10.11
PHP 7.4.30
mysql 5.7.39