Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Great module, like the way it works. Only thing I can't figure out is the format for uploading date fields in the profiles. What is the format I am supposed to use?
Comment | File | Size | Author |
---|---|---|---|
#36 | testfile.xls | 1.3 KB | ozguy |
#23 | Membership data test.txt | 180 bytes | cbrody |
#19 | user_import_profile_date_field_D5_3.patch | 17.01 KB | leebroozlee |
#19 | user_import_profile_date_field_D6_3.patch | 12.59 KB | leebroozlee |
#18 | user_import_profile_date_field_D5_2.patch | 17.01 KB | Agileware |
Comments
Comment #1
mshaver CreditAttribution: mshaver commentedI have a date cell formated as "d-mmm-yy" and it seems to come through just fine.
Comment #2
BarryHoggard CreditAttribution: BarryHoggard commentedI am unable to get a profile field that is a date to work. I have an expiration date in the old system I'm importing. I've tried these formats:
31-12-2010
01-September-2008
"Mon, 01 Sep 2008 00:00:00 UTC"
The imports run without any warnings, but the profile_expire_date is still empty so that when I try to view the data it defaults to today's date.
What is the proper date format? Here a typical line of my file:
First,Last,password,31-12-2010
Comment #3
ferrangil CreditAttribution: ferrangil commentedI never tried but I think the default date in Drupal looks like
2004-02-12T15:19:21+00:00
but I'm not sure...
just try to put some dates from one of the rows in the .csv and see if the date keeps on the system.
Comment #4
pivica CreditAttribution: pivica commentedI think i found a bug in _user_import_save_profile function. Problem is that profile module save date fields in serialized format so its not possible to just save dates like plain texts. I have modified _user_import_save_profile function to work correctly with date fields (although not sure is this the best way):
For more info take a look to http://api.drupal.org/api/function/profile_save_profile/5 and http://api.drupal.org/api/function/_profile_field_serialize/5
Comment #5
hoggo CreditAttribution: hoggo commentedI have experienced the smae problems trying to import a date field and believe you have hit the nail right on the head with your code change.
For anyone (like me) preparing their data for import using Excel, remember to format the date fields as 'm/d/yyyy' before saving as CSV and importing. If you leave the formatting at the default 'mm/d/yyyy' or 'mm/dd/yyyy' you will end up with leading zeroes on at least the month field for months up to September and they will not import properly (defaulting instead to January).
Comment #6
mizengineer CreditAttribution: mizengineer commentedHave applied the modifications in #4 to the user_import.module and formatted as m/d/yyyy as suggested in #5 and this works! Thanks very much, I've spent way to long trying to solve this problem and the suggestions in #1 to format the date as d-mmm-yy does NOT work. Wonder if this should be a formal patch?
Comment #7
jrborba CreditAttribution: jrborba commentedGood "patch" in #4 for this wonder module.
For other date formats, like dd/M/yyyy (in my case), simply change the order of list and serialized array.
Dont forget the "M". "MM" doesnt works.
*********ADDED LATER***********
My imported fields are repeated. Even if I import in M/dd/yyyy format (not a date problem). I identify this problem in view module, in a list of users, and check in the database table. In every user imported, only in 3 fields of profile (of 10) information are included, but the same fields are included with empty values (repeated). The other fields are empty, and are OK. After a look in the profile over an administration interface and SAVING, the problem are solved, with the empty duplicated fields deleted by drupal. I will dont do this with 1200 included users........................
Any suggestion?
Regards,
Comment #8
ferrangil CreditAttribution: ferrangil commentedSolved in here:
http://drupal.org/node/174322
There's one comment at the end that suggests to comment one line, and you will not have any duplicate field.
Cheers
Comment #9
jrborba CreditAttribution: jrborba commentedMan,
You are the best. Kill my headache!!!
Thanks a lot.
regards,
Comment #10
ferrangil CreditAttribution: ferrangil commentedYou're welcome :)
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #12
ardnet CreditAttribution: ardnet commentedHi all,
First of all, the version of user_import module that i use is: user_import-5.x-2.8.tar.gz
For the date format, I have tried suggestion in #4, but i think this code need to implement more in the profile_user_import_save_profile function, which is in profile.inc
I implement like the one below:
And also need some little changes in function profile_user_import_after_save, which is like the one below:
Note that, without changes in function profile_user_import_after_save, your date will still not display properly, even though the value in table profile_values already in a form of serialized array.
So the correct date format should be: MM/DD/YYYY
Thanks.
Comment #13
Agileware CreditAttribution: Agileware commentedI have created a patch with the code in #12.
It also adds a select option on the configure page (admin/user/user_import/configure) that allows you to select a date format to use (more date format options can be added if required).
The option only appears if the profile module is enabled.
The patch is against 5.x-2.8 and seems to work correctly in my testing.
Comment #14
Agileware CreditAttribution: Agileware commentedRenaming to properly describe the issue
Comment #15
Agileware CreditAttribution: Agileware commentedHere is a 6 version of this patch.
I have not been able to test it yet, I just did a quick port of the 5 patch as all the changed code seems to be the same across both versions.
Comment #16
Agileware CreditAttribution: Agileware commentedI have marked #449466: date field does not seem to work as a duplicate of this issue.
Comment #17
Agileware CreditAttribution: Agileware commentedComment #18
Agileware CreditAttribution: Agileware commentedI have made a little change to these patches as I was having problems with days and months with a leading zero.
The patch now strips leading zeros from the day and month parts and that problem is fixed.
Comment #19
leebroozlee CreditAttribution: leebroozlee commentedHi,
Just one small typo fix affecting YYYY/MM/DD users:
-+ else if ($date_format == 'YYYY/MM/DD/') {
++ else if ($date_format == 'YYYY/MM/DD') {
Cheers,
Paul
Comment #20
Agileware CreditAttribution: Agileware commentedOops, thanks for fixing that.
Comment #22
Agileware CreditAttribution: Agileware commentedCan you give some more information like a date that doesn't go in or something?
Comment #23
cbrody CreditAttribution: cbrody commentedI've attached a sample file I tried to upload. The dates import correctly if I specify a text field as the destination but then they need transforming to be of any use.
Comment #24
Agileware CreditAttribution: Agileware commentedI was able to successfully import your file in with date data going into a date field.
I am using Drupal 5.12 and User import 5.x-2.8
The field I am importing into is a date field not a text field
On admin/user/user_import/configure for Date field format: I have selected DD/MM/YYYY
Is there anything else you can think of about your set up that might affect this import?
Comment #25
cbrody CreditAttribution: cbrody commentedOnly that I'm using Drupal 6.12 and User Import 6.x-1.2.
Comment #26
Agileware CreditAttribution: Agileware commentedThat would explain why it does not work as expected. This patch is for Drupal 5 and it is rare that a module is so similar from D5 to D6 that a patch will work for both.
And seeing as this patch will more likely be accepted with a 6 version as well I'll change the issue.
This patch will have to be ported to D6.
Comment #27
Agileware CreditAttribution: Agileware commentedI won't be able to work on porting it to 6 any time soon though so if anyone else wants to that would be great.
Comment #28
saccard CreditAttribution: saccard commentedIt would be nice, if this could be fixed for the D6 version of the module.
For importing users with a field "birthday" I used this "workaround":
1. Open the CSV file with open office
2. Insert a new column "birthday new"
3. Enter the following formula (this is for the german OO version!)
="a:3:{s:3:" & ZEICHEN(34) & "day" & ZEICHEN(34) & ";s:" & LÄNGE(TAG(BU2))&":"&ZEICHEN(34) &TAG(BU2)&ZEICHEN(34)&";s:5:"&ZEICHEN(34)&"month"&ZEICHEN(34)&";s:"&LÄNGE(MONAT(BU2)) &":"&ZEICHEN(34)&MONAT(BU2)&ZEICHEN(34)&";s:4:"&ZEICHEN(34)&"year"&ZEICHEN(34)&";s:" &LÄNGE(JAHR(BU2))&":"&ZEICHEN(34)&JAHR(BU2)&ZEICHEN(34)&";}"
4. Copy the formula down into each row
5. Repeat steps 1 to 4 if you have more date fields
6. Import the CSV file
The formula converts a date field entry like "dd.mm.yyyy" to something like this
a:3:{s:3:"day";s:2:"31";s:5:"month";s:1:"3";s:4:"year";s:4:"2000";}
Thats what the profile field expects.
Comment #29
ozguy CreditAttribution: ozguy commentedDumb question.
How do I implement the patch in #19 for the latest Drupal 6 install?
It's not cut and paste. Is there a script i run in install it?
Thanks,
Al
Comment #30
Agileware CreditAttribution: Agileware commentedReading back through this issue some of the conversation doesn't make much sense (my fault).
There is already a patch for drupal 6 in #19
So is the consensus that the D6 patch in #19 doesn't work properly? I'll test soon if I get a chance.
@ozguy:
All the info you need for making or applying patches can be found here - http://drupal.org/patch
Comment #31
ozguy CreditAttribution: ozguy commentedThanks for your advice Justin. I followed the patch howto, and also watched the video on patching, however had issues with running the patch.
I copied the patch contents for Drupal 6 (I'm using Drupal 6.14 BTW) and saved the file to the "/var/www/html/drupal/sites/all/modules" directory and tried to run it with "patch < user_import.patch", but it seems to want different directories "user_import6 and user_import6_old", and returns the "file to patch" request. I renamed the directory user_import6, but it still had issues finding the files.
I filled the values manually, and it seemed to work, but it finally failed with a hunk error:
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 247 with fuzz 1.
I ran the import after the patch ran, and date fields were corrupted.
Any advice?
Thanks in advance,
Al
Here are the patch run messages:
[root@Drupal6 modules]# patch < user_import.patch
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/supported/profile.inc user_import6/supported/profile.inc
|--- user_import6_old/supported/profile.inc 2009-04-05 02:24:18.000000000 +1000
|+++ supported/profile.inc 2009-05-21 11:35:39.000000000 +1000
--------------------------
File to patch: user_import6/supported/profile.inc
patching file user_import6/supported/profile.inc
Reversed (or previously applied) patch detected! Assume -R? [n]
[root@Drupal6 modules]# patch < user_import.patch
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/supported/profile.inc user_import6/supported/profile.inc
|--- user_import6_old/supported/profile.inc 2009-04-05 02:24:18.000000000 +1000
|+++ supported/profile.inc 2009-05-21 11:35:39.000000000 +1000
--------------------------
File to patch: user_import6/supported/profile.inc
patching file user_import6/supported/profile.inc
Reversed (or previously applied) patch detected! Assume -R? [n] y
can't find file to patch at input line 133
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/user_import.install user_import6/user_import.install
|--- user_import6_old/user_import.install 2009-03-25 22:31:09.000000000 +1100
|+++ user_import.install 2009-05-21 10:05:51.000000000 +1000
--------------------------
File to patch:
[root@Drupal6 modules]# patch < user_import.patch
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/supported/profile.inc user_import6/supported/profile.inc
|--- user_import6_old/supported/profile.inc 2009-04-05 02:24:18.000000000 +1000
|+++ supported/profile.inc 2009-05-21 11:35:39.000000000 +1000
--------------------------
File to patch: user_import6/supported/profile.inc
patching file user_import6/supported/profile.inc
can't find file to patch at input line 133
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/user_import.install user_import6/user_import.install
|--- user_import6_old/user_import.install 2009-03-25 22:31:09.000000000 +1100
|+++ user_import.install 2009-05-21 10:05:51.000000000 +1000
--------------------------
File to patch: user_import6/user_import.install
patching file user_import6/user_import.install
can't find file to patch at input line 153
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN user_import6_old/user_import.module user_import6/user_import.module
|--- user_import6_old/user_import.module 2009-03-22 09:32:42.000000000 +1100
|+++ user_import.module 2009-05-21 10:15:38.000000000 +1000
--------------------------
File to patch: user_import6/user_import.module
patching file user_import6/user_import.module
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 247 with fuzz 1.
Comment #32
Agileware CreditAttribution: Agileware commented@ozguy,
Your problem is probably having the patch in the sites/all/modules folder.
Most patches are made to be run from the modules folder itself. So you would put it in the sites/all/modules/user_import folder and then run with
Comment #33
ozguy CreditAttribution: ozguy commentedJustin,
Over all the D6 patch seems to work, as it does import the date fields into the fields correctly, however is also seems to store the char value "NULL" in the field if "NULL" is placed in the contents of the field.
The display part in the user page (www.site.com/users/xxxxyyyy) that seems to be messed up now.
It did work better running it as you recommended, however the hunk error sill continues:
[root@Drupal6 modules]# patch -p0 < user_import.patch
patching file user_import6_old/supported/profile.inc
patching file user_import6_old/user_import.install
patching file user_import6_old/user_import.module
patch unexpectedly ends in middle of line
Hunk #2 succeeded at 247 with fuzz 1.
Either way the user import process runs without errors, and looking at the profile_values table reveals that the dates seem to have been imported correctly, showing exactly as the data imported via format mm/d/yyyy.
However reviewing the user data shows the date fields to be corrupted (dsiplaying 00/00/N) as well as displaying the following screen errors:
messages:warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal-6.14/includes/form.inc on line 1726.
Which seems to match the date fields which had a value of "NULL".
I assume means that the date format that the user information display code is looking for the data is a different format, even though the fields are set up as dates.
What value should I place in the date fields if there is no value? Null does not seem to work (actually stored as "NULL" in the table field), the current days date is displayed if no date is stored in that field.
Once again, thanks for your help Justin.
Alan
Comment #34
Agileware CreditAttribution: Agileware commentedI have tested the D6 patch in #19 again (now with Drupal 6.15 & user_import 6.x-2.3) and it works for me
[EDIT] I posted this before I saw post #33 so this is not in response to that post.
Comment #35
Agileware CreditAttribution: Agileware commentedI just applied the patch in #19 to user_import 6.x-2.3 and it applied cleanly so your patch file might be messed up or you are not using a clean version of user_import or the patch is not being applied correctly or something.
Aside from that, hunk succeeding with fuzz isn't a great cause for concern but I would investigate the "patch unexpectedly ends in middle of line" part. It would be best if that wasn't there when you applied the patch.
When I get a bit of spare time I'll have a look into the NULL value issue.
If you can give me a csv file with a few rows that cause problems I can have a better look.
Comment #36
ozguy CreditAttribution: ozguy commentedJustin,
I've attached the CSV file as an XLS file as CSV file extension is not up loadable.
I'm wondering if the way I copied the patch into the system caused the error. I opened the patch to a new browser page, and copied and pasted all contents into the server patch file via SSH. The file looks fine with no truncation or mangled lines, but maybe that was the cause. I'll try again later.
I'll be upgrading to Drupal 6.15 tonight and will also re-install the user_import and re-test the patch then.
Al
Comment #37
Agileware CreditAttribution: Agileware commentedThanks for the file, I'll test it when I get a few spare minutes.
Easiest way to get the patches is to right click the link and save as. Then you'll get the actual file.
Comment #38
ozguy CreditAttribution: ozguy commentedDid you get a chance to check it out Justin?
I'm a week away from going live, and still can't get around the issues no matter what module options I try.
The data loads fine into the DB, but the display in the user profile is shot.
Even worse, the date fields that have no values show as the current day in the users profile. Seems there's no way to set a null default, or be able to set it to null once the user has been created. Painful.
Thanks for your help so far. It's been greatly appreciated.
Al
Comment #39
Agileware CreditAttribution: Agileware commentedSorry, I haven't got back to this yet. I blame christmas.
I'll have a look when I get home today.
Comment #40
Agileware CreditAttribution: Agileware commentedI posted a reply to this yesterday but I don't know where it went, sorry.
I have had a look at your problem and the issue is that the date field won't accept the text NULL as a value.
If you change null to a blank cell in your spreadsheet you will stop the gmmktime() warnings.
But then you will still have 00/00/ for the dates and when that profile is next saved and no dates have been entered it will be 01/01/1900.
The problem seems to be that profile date fields just aren't really very good. Profile fields in general are not very flexible.
Profile date fields can't handle not having an empty date.
This means you would have to give fields without dates the value 0/01/1900 or something.
If this is no good to you another possible option might be to do the following:
* Using the content profile module along with the cck and date modules you could create a profile content type.
* Then you could use user_import to import the basic user details from your spreadsheet
* Then using the node import module you could import the extra profile fields from the spreadsheet into your profile content type. From memory I think all you need to do is set the author of the profile node to the username of the user it belongs to and it will link that node to the user. I think it also allows you to make the profile node a tab on the users profile.
This way the use of date & node_import should give you better flexibility.
Comment #41
ozguy CreditAttribution: ozguy commentedThanks for the feedback and advice.
I have tried the content profile, along with CCK, and date and phone modules, which are a far improvement over the standard user profile, especially in terms of data normalization, as well as data validation. Unfortunately the Non-for-profit site goes live this coming Wednesday, and my time has run out, so I must stick with the user profile for now.
I did do some further checking to determine why the user profile page does not like the date format I was using. I added a user manually, adding all fields including the dates. When I looked in the database (profile_values) I found that the dates were being stored as:
a:3:{s:5:"month";s:1:"9";s:3:"day";s:2:"10";s:4:"year";s:4:"1990";} for a date of 9/10/1990.
So I thought, what the heck, and I wrote a perl script that converts all dates in the user import input file into that exact date format, and uploaded all of the data perfectly. I happily noticed that the date fields looked exactly the same as the manually added dates for a new user in the database table.
Got a bit of a shock when I went to the imported users profile page and saw these errors on the page (one for each date field on the page):
# warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal/includes/form.inc on line 1726.
# warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal/includes/form.inc on line 1726.
# warning: gmmktime() expects parameter 4 to be long, string given in /var/www/html/drupal/includes/form.inc on line 1726.
I'm using drupal 6.14, and the form.inc include file has the following code at the line mentioned:
1722 /**
1723 * Helper function for usage with drupal_map_assoc to display month names.
1724 */
1725 function map_month($month) {
1726 return format_date(gmmktime(0, 0, 0, $month, 2, 1970), 'custom', 'M', 0);
1727 }
I was quite stunned at this. All of the date values looked like this on the page : "00/00/a". (it looked like 00/00/N when I imported the date as mm/dd/yyyy earlier)
If I go into edit mode, it shows all dates as "Jan/1/1900", a default in case of error i guess.
What I can only assume is that while the dates in the profile_value are identical regardless of how the data was added (via manually creating a user, or upload via user import), there is some other processing done behind the "add user/user edit" page that either places the date in other DB table fields as well, or somehow sets a data trigger, or something.
And then we get the date field default values in the user edit pages of the current, with no way to set them to NULL.......Don't get me going on that.......
Anyhoo, What do you think guru's? How can identical data in a date field be handled differently on a display page depending on how the data was added? Riddle me that one batman.......
Thanks in advance for any further advice or info,
Al
Comment #42
Agileware CreditAttribution: Agileware commentedWell without having the time to look into it properly:
Parameter 4 for gmmktime() is month so that error means the function is being passed a sting instead of a number for the month value.
To see what is being passed into this function you can use the devel module and use the dpm() or dd() function in form.inc to check the values being passed into the gmmktime() function.
I don't think drupal would have any knowledge of how the data was entered so if the data in the database is the same then it should display the same. I would be leaning towards there being something different in the database data between the dates that work and the dates that look like "00/00/a".
Comment #43
ozguy CreditAttribution: ozguy commentedThanks for the advice.
Which devel module in particular should I use Agileware? Profile is part of the Drupal core which I enabled.
I can assure you that I've checked the date fields, one character at a time, and have even copied a manually added date from the database to all of the dates in an imported users DB entries (before viewing or editing the profile), and the error appears. Really weird.
Al
Comment #44
Agileware CreditAttribution: Agileware commentedDevel module
It comes with a few other modules but you shouldn't need any of them.
If you enable devel it has functions you can use that help with debugging.
dpm($var); will print the value of $var to the screen. You can put constants, variables or whatever in as $var - http://api.lullabot.com/dpm
It is similar (but better) to php's print_r
dd($var); Does the same as dpm but instead of printing to screen it will print to a file (it will create one if it isn't there) called drupal_debug.txt in whatever your site specifies as it's temp folder. - http://api.lullabot.com/dd
They are both helpful for telling you what value a variable holds at a certain time.
There are other useful things in there too but those are the ones I use most often.
Comment #45
ozguy CreditAttribution: ozguy commentedI've installed many modules in the past for this web site, but I must say I'm a bit perplexed that I cannot get the devel module up and running.
I downloaded it, installed it in the site/all/modules directory, set it's permission the same as the other modules, made every file in ithe module executable, yet I still cannot see it in the modules page to enable it. I even moved it to the core module directory. same result.
Can't see it in the modules list to enable it. The system is out to get me I'm sure of it.....
The rest of the site is fully functional, so I feel good about that.
Thanks for your advice so far mate. I'll try to keep banging away at it. I hate to lose.
Al
Comment #46
kentr CreditAttribution: kentr commentedThanks for working on a patch. I was wondering if you considered the
date_parse()
function to reduce the need for pre-formatting the input data (http://www.php.net/manual/en/function.date-parse.php).It automatically tries to recognize different standard date formats.
Apologies that I don't have time right now to put it into another patch.
Comment #47
kentr CreditAttribution: kentr commentedOops - that function's only in PHP5. Should be able to get the same functionality combining
strototime()
andgetdate()
, which are both PHP4 compatible.Something like:
Comment #48
bryancasler CreditAttribution: bryancasler commentedWill the patch in #19 work with v2.3?
Comment #49
webdevbyjoss CreditAttribution: webdevbyjoss commentedsubscribing
Comment #50
Emiel Rombouts CreditAttribution: Emiel Rombouts commentedI'm having this same issue right now. I imported the dates using this syntax: a:3:{s:5:"month";s:1:"9";s:3:"day";s:2:"10";s:4:"year";s:4:"1990";}.
I get the following error as well:
warning: gmmktime() expects parameter 4 to be long, string given in C:\wamp\www\drupal\includes\form.inc on line 1728.
When browsing through the database I noticed that the date is not only stored in the profile_values table, but also in the users table in the data field. When setting the date manually this isn't the case.
Comment #51
Emiel Rombouts CreditAttribution: Emiel Rombouts commentedI changed this code on line 84 in user_import\supported\profile.inc:
$data[$field->name] = $value;
return;
to:
unset($data[$field->name]);
return;
This causes the field only to be written to the profile table and it seems to have solved the error.
Comment #52
mstrelan CreditAttribution: mstrelan commentedsubscribe
Comment #53
aufumy CreditAttribution: aufumy commentedI noticed in the patch above, it uses $update_setting_per_module which contains an array of values for roles, profiles, password, instead of $update_setting which only amounts to either true or false.
In a patch to allow user_import to be compatible with shared_email http://drupal.org/node/497652#comment-3328332
I do something similar as I need the array of values rather than just true/false
Comment #54
mstrelan CreditAttribution: mstrelan commented+1 for date_parse however date_parse thinks that non US dates using a forward slash are US dates, so that doesn't work. Ultimately I'd like to be able to enter a custom format. The spreadsheet I'm trying to parse has
D M j G:i:s \G\M\TO Y
!Comment #55
mstrelan CreditAttribution: mstrelan commentedHaving said this (#54) I am extremely happy about this patch and think it should be committed! You should probably also be able to select the date format per import as well as setting the default.
Comment #56
wOOge CreditAttribution: wOOge commentedAny headway made on this recently?
I'm trying the D6 patch from #19 on release user_import 6.x-2.4
Update
The import succeeds — but I noticed in the database, the date was saved as text
"1/2/2011" - instead of the UTC format the date field requires "2011-02-01T00:00:00"
How can I fix this?
Update 2
Found a solution — the CSV file must have the date in the format: "2011-2-1", with dashes and not "/" slashes.
Comment #57
Marko B CreditAttribution: Marko B commentedThere is a file with applied patch here (and some other changes)
http://www.drupaldump.com/user-import-patched-date-import-working
When i started using drupal i also hated applying patches and in windows env. it was always some problems bugs wrong versions etc. Wish people would just upload patched version also with a patch just for neewbies to have it easier.
Comment #58
Robert Castelo CreditAttribution: Robert Castelo commentedAdded to 6.x-3.0-beta2.
Needs testing.