CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Date is 100 years off
Pages: [1]

Author Topic: Date is 100 years off  (Read 3577 times)

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Date is 100 years off
May 20, 2008, 09:53:01 am
I'm importing data from a .csv file - got everything working, but the dates (birth, voter registration date) are 100 years late. I tried changing the start and end offsets of Advanced Date options to 0 (Start Offset was originally set to 100), deleting and reimporting the data, but it still doesn't work.

I can't find any documentation on Date Offset - but why does everything look fine in the import stage, yet display 100 years late? Any ideas? Thank you!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Date is 100 years off
May 20, 2008, 10:02:31 am
Start and End Date offsets affect what years are available in the Date input field dropdowns - so that shouldn't be an issue - altho you should not set it to 0 or your dates won't behave properly when bringing up the record for editing (the drop-down won't show past years - and so a birth year like 1960 won't be "selected").

What format are the imported dates in? Did you check an imported record in the DB via MySQL / phpMyAdmin to see how it looks in a contact record?

Perhaps do a simple import of 1 or 2 records w/ birth dates (sanitize the other data) on the public demo and see if you get the same results.
Protect your investment in CiviCRM by  becoming a Member!

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 20, 2008, 11:44:55 am
I am a dunce. If the date in the original file is formatted as 01/01/00, how is the program to know if it's 1900 or 2000? I'll just reformat the date info and I'll assume this will work OK - so sorry to bother! eep.

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 25, 2008, 08:29:19 am
Actually, this is a bug - minor, but annoying. On the contact page, birthdays will appear like "October 27th, 2037" no matter what you do. The original file .csv file has the years stored correctly. I'm dealing with voter lists, so no one will have been born before 2000, but this should be addressed.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date is 100 years off
May 25, 2008, 11:40:32 am

can u reproduce this bug on the demo server and if so file an issue. we'll take care of this for 2.1

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 25, 2008, 02:37:51 pm
Reproduced. See contact "Julie Wells" on the demo site (this is an actual voter record, so delete it once you check) - you'll see her birth year is 2060. This is imported from an Excel .csv file.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date is 100 years off
May 25, 2008, 02:56:06 pm

1. can you reproduce it using some made up data. if you can keep the import data real small (name and birth date) that would help

2. can u also attach the csv file (and describe the mapping if complex) you used in the process to your next message

3. i deleted julie wells info, since it was real daya

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 26, 2008, 09:30:08 am
Attached is the actual .csv file I used to test. Just remove the .txt suffix.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date is 100 years off
May 26, 2008, 12:10:27 pm

there is a bug in 2.0 with regard to date conversion. i've filed and fixed the issue for 2.1 here:

http://issues.civicrm.org/jira/browse/CRM-3152

If you want to backport the fisheye changeset is here:

http://fisheye.civicrm.org/changelog/CiviCRM/trunk?cs=14711

If you are not familiar with patch/diff/php, we recommend you ask someone local for help

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 28, 2008, 03:19:26 pm
Good work on fixing this... it's a more important issue than I had originally realized; for example, if you're trying to select recently-registered voters by registration date, you're toast. You'll see voters registered after, say, Jan 1, 2001, which will include voters registered in, say, 2057.

I'm not familiar with patch/diff - how difficult would it be to post the modified file? I would assume this would replace Date.php in the Packages folder.

Thanks again - nice to know it wasn't me this time!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date is 100 years off
May 28, 2008, 04:52:54 pm

please ask someone local who has expertise with php/patching files to help you out. you can also get the entire file from the fisheye links below

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 28, 2008, 06:25:11 pm
I'm sorry... I don't see any links below. I downloaded what I thought was the entire file from the Fisheye link above and replaced the Date.php in the Package folder - behavior was unchanged. Is that where it goes?

On Edit Contact, all birthdays come up as December 31, 1969 - this is with the original Date.php in place. Very odd behavior here...

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Date is 100 years off
May 29, 2008, 01:20:26 am

the raw file is at: http://fisheye.civicrm.org/browse/~raw,r=14711/CiviCRM/trunk/CRM/Utils/Date.php

You should also test and ensure it works as you expect at: http://sandbox.civicrm.org/

if replacing that file does not work in your install, you might want to consider hiring the web access team from http://civicrm.org/professional/  to log on and check your install and patch the right file etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

bcobin

  • I post frequently
  • ***
  • Posts: 337
  • Karma: 9
    • InterCreative Media
  • CiviCRM version: 4.3.3
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.9
  • PHP version: 5.3
Re: Date is 100 years off
May 30, 2008, 12:28:31 pm
Thank you - the new file works. Seeing that it needed to reside in the Utils folder was a help, too (there's a different Data.php in the Packages folder.) I did need to reimport all the data, though.

A pretty important fix, I'd say - thank you very much!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Date is 100 years off

This forum was archived on 2017-11-26.