I have a date cck field with widget type 'text field with custom input format'. My display format is Y (year only). Whenever I visit the node, it gives following error message and in the date field displays '1104' (whereas my year is 2005). But when I edit the node, the date field show '2005'. It started to appear after I upgraded to rc-6. I tried upgrading to latest dev but same result.

date_create() [<a href='function.date-create'>function.date-create</a>]: Failed to parse time string (1104-51-69 00:00:00) at position 6 (1): Unexpected character in /html/sites/all/modules/date/date_api.module on line 794.
CommentFileSizeAuthor
#11 export_date.txt2.87 KBnatali

Comments

kelvinwong’s picture

Title: Error date_create() - failed to parse timestring » +1
kelvinwong’s picture

Title: +1 » Error date_create() - failed to parse timestring

Sorry, I didn't mean to change the title.

I just wanna say I got the same problem

phl3tch’s picture

Having the same problem. Looks like a bug was introduced in the most recent release.

steve22’s picture

My opinion is 'date' module is probably the worst supported module of drupal. It's been nearly 3 weeks since the 6.x-2.0 and the most critical bug has not been fixed. Since upgrade my site has become almost completely unusable.

karens’s picture

Status: Active » Postponed (maintainer needs more info)

Worst supported module of drupal

@steve22, Thanks a lot. I spend hundreds and hundreds of (unpaid) hours doing this and have made thousands (literally thousands) of commits. Comments like this make it all worth while.

To everyone else, try the -dev version of the code. I'm pretty sure this should be fixed.

arlinsandbulte’s picture

Don't take it personally, Karen. We can see how much time and effort you put into the Date and Calendar modules and are very appreciative. Both these modules are quite complex, and I think you are doing a fantastic job.

I actually think these modules are some of the best supported. The issue queues are active and there are other users that help out a lot. There are a lot of people using these modules, all trying to bend them to their will, so bugs (and feature requests) are part of the game.

Instead of criticizing Karen, more people need to ask "I find these modules very useful, How can I help make them better?"

karens’s picture

@arlinsandbulte, thx. I should just ignore that stuff. I usually do.

natali’s picture

I still have the same problem.
warning: date_create() [function.date-create]: Failed to parse time string (1230-76-44 00:00:00) at position 6 (6): Unexpected character in /udata/WWW/xwww.utia.cas.cz/sites/all/modules/date/date_api.module on line 798.
I did all TROUBLESHOOTING part in Date module, but problem still remains.
What type of information do you need?

restyler’s picture

How do you manage to create '1230-76-44 00:00:00' type of dates ?
I have the similar problem with latest -dev release.
I'm using node_import, and I get this:
"warning: date_create() [function.date-create]: Failed to parse time string (2008-30-09 00:00:00) at position 6 (0): Unexpected character in Z:\home\munworld\www\sites\all\modules\date\date_api.module on line 1162."

As far as I understand, the date_create function expects Y-m-d format, but it gets Y-d-m.
So I've managed to fix it (quick&dirty, but it worked for me)
by switching the values by adding

$date = preg_replace('/^(\d{4})-(\d{2})-(\d{2})/', "\$1-\$3-\$2", $date); 

before the date_create() call. I'm sure this approach won't help people that are trying to convert weird strings like "'1230-76-44 00:00:00'" to the date object.

karens’s picture

The message 'Failed to parse time string (1230-76-44 00:00:00)' implies it is getting a timestamp input (12307644) and trying to evaluate it as a datetime value. If you are doing that with some custom code, there's a problem in your code. If you're getting that with the standard Date module processing, I need more information about how your date field is set up (you can create an export using the Content Copy module), and I also need to know exactly what you are doing when you see the message.

The second is probably similar. I don't know what node_import is sending to Date, but it's obviously something in the wrong format.

natali’s picture

StatusFileSize
new2.87 KB

You are right, i have in DB 1230764400 and it sould be year 2009, but it show 1230 and this warning. I have field Datestamp 'Zahajeni' in my view.

I see message when
* edit my contemplate (body variables - $node->field_zahajeni[0]['view'] 1230 )
* look at my projekt as page - i have "$node->field_zahajeni[0]['view']" - in my contemplate
* look at list of projekts - it's view

All these setup worked, but after some Date update (i'm not sure which one) it has stopped working :( Thank you for your time!

Field has setup - should be in attachement - export_date.txt

arlinsandbulte’s picture

natali, steve et. al.
What is the status of this report?
There has been no activity since April (4 months).

Just looking to clear some things from the queue.

arlinsandbulte’s picture

Status: Postponed (maintainer needs more info) » Fixed

No reply, I am marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupalfan2’s picture

Status: Closed (fixed) » Needs work

I get this error too. Is there any solution?

drupalfan2’s picture

Please do not close the, this is a bug!

karens’s picture

Category: bug » support
Status: Needs work » Postponed (maintainer needs more info)

This is an old report without enough information to do anything. I can't fix bugs without enough information to reproduce the problem. Some things are not in fact bugs from this module, they may be bugs in other modules or problem in your setup.

It should only be re-opened if someone can report that you can produce a problem using the latest code (the dev version with all the latest changes) in a clean Drupal installation with no other modules enabled. Otherwise it is a support request that has something to do with your individual setup that cannot be answered without a lot more information.

karens’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

No response to my question, so there's nothing I can do.