The current strtotime action provides a date in text format. There's currently no action to convert strings to dates, so the result is of somewhat limited use.

This patch adds a second strtotime function, but it outputs in date format rather than text.

Comments

mjcarter’s picture

Status: Active » Needs review
StatusFileSize
new1.18 KB
Leiph’s picture

Are there any plans to put this patch into release?

/Leiph

mjcarter’s picture

Hi Leiph, you may change the issue status to "reviewed and tested by the community" if you have used it successfully without issue, this will help with getting things committed

shixish’s picture

I tried using the patch but it didn't take for some reason so I just applied the patch manually.
I made a new patch file. The second part of the original patch added a redundant function, so I left it off.

I tested this patch and it works for me, providing the functionality I was looking for (output as a date).

okday’s picture

hi,

first, thank you for the patch.

i've tried the patch and i have a question.

can you tell me if my issue is normal.

If i enter a date as source for the strtotime function it modify my date by removine the min and seconds.

my source date is: 2014-11-11 18:31:36
and result is 2014-11-11 18:30:30

can you tell my how to resolve this?

thanks

okday’s picture

hi,

forget about my issue. when i manually enter a date in the date field it also change and remove the min and seconds. it is an issue with the date module

THANKS

Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

I am using patch #4 to convert a text (date string) to a date field> perfect!
Thanks.

greggturnbull’s picture

#4 did the trick for me - after conversion, date the variable is now available to set value later in the rule. Well done.

sano’s picture

Worked for me as well, but only after clearing all caches. Thanks.

mducharme’s picture

#4 works for me as well across multiple strtotime input formats. Excellent addition.