1. jimmywiddle
  2. RO CSVI
  3. Monday, 17 August 2015
  4.  Subscribe via email
Hi, Ive just discovered something is changing the dates when importing from the CSV file into a k2 extra field.

The dates for all but one k2 item has increased the days by 1 day, ie date in the CSV file is 17/09/2015 when imported into a k2 extra field the date shows 18/09/2015

Please help ..thanks! :)
Accepted Answer Pending Moderation
Hello,

Actually it is not 1 day but more likely 2 hours because the date is stored as a Joomla date. Post the debug log and let's see how the date is stored.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi, thanks is attached.

Is showing as 1 whole day difference from looking at the data in the CSV and the k2 extra field ie. CSV: 17/09/2015 k2 extra field: 18/09/2015
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,

I don't see that date at all in the zipfile or the file you imported. Tell me, which timezone is your site set to?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi,

Please see attached for the CSV import file, you will see 'Property ID: 301IC' the field 'Room1DateAvailable' is 17/09/2015 but on the backend and frontend of the site the k2 item (extra field) for this item is showing '16/09/2015' a link to the frontend is below:
http://www.luxuryflatshares.co.uk/flatshare/101-canary-wharf-e14-9ez-301ic
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello,

Please also answer my previous question:
Tell me, which timezone is your site set to?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Sorry, as per joomla Global Configuration its 'Universal Time, Coordinated (UTC) '
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Is that correct for the place where you live? It shouldn't be a city from the list? The date might as well be OK once you choose the correct city from the list.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Do you really think this will have an effect as its a k2 extra field?
Also would the server time come into it?

Surely the date in the CSV file is simply imported into the extra field? But something is happening somewhere to change this date?

Do I need to do some testing with the correct timezone?
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Testing complete, I set the Server Time Zone* to London (although this is our location Im not sure about the server which Im pretty sure this setting is refering to) in joomla Global Configuration, ran the import, but its still substracting 1 day from the CSV dates.
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
So I checked this further and the date is actually converted to a base date/time GMT with no timezone applied. However, I guess for the extra field the timezone is irrelevant.

Attached is a patch file that makes the date no longer gets a timezone applied. You can load the patch via the maintenance menu. After that you can run the import and the date should be OK.

Let me know how it goes.
Attachments (1)
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Thanks so much for that!
I just installed the patch and ran the import, but im afraid to say it hasn't effected the date, eg. this property (id: 301ic) is still showing the 16th but in the CSV the 17th
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Are you running CSVI 5 or CSVI 6? The patch is for CSVI 6 actually.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hi, Ye im running Version 5.21.2

Did csvi 6 only just become stable on the 16th right?

Theres been a few patches you made for me on this installation, I really didn't the hassle of upgrading right now.. isit necessary?
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Hey Jimmy,

CSVI 6 became stable last month, the CSVI 6.1.0 was a new release in the CSVI 6 cycle.

I really didn't the hassle of upgrading right now.. isit necessary?
Not necessary you can apply the change manually as well. Find the file administrator/components/com_csvi/models/com_k2/import/itemimport.php and in that file look for the line that says
$value = $this->convertDate($this->$title, 'date');
and replace it with
$value = $this->convertDate($this->$title, 'date', 'user');
that should be enough to make it work.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Once again many thanks for this!

Really wish I could say it worked, but no change in date im afraid!

(I found and made the change in the file you said)
  1. more than a month ago
  2. RO CSVI
  3. # 15
Accepted Answer Pending Moderation
Oh my bad, I was looking at the CSVI 6 code. That change won't have any effect on CSVI 5 but leave that change. Find the file administrator/components/com_csvi/models/importfile.php and locate the line 1148
return $date->format('Y-m-d', false, false);

and change this to:
return ($tz == 'user') ? date('Y-m-d', $old_date) : $date->format('Y-m-d', false, false);

Run the import once more and see if that keeps the date.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Many thanks, again, looks good! your support is special! would recommend csvi everytime!
  1. more than a month ago
  2. RO CSVI
  3. # 17
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!