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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | rules_data_transforms-add-strtotome-date-output-2126147-2.patch | 739 bytes | shixish |
| #1 | rules_data_transforms-add-strtotome-date-output-2126147-1.patch | 1.18 KB | mjcarter |
Comments
Comment #1
mjcarter commentedComment #2
Leiph commentedAre there any plans to put this patch into release?
/Leiph
Comment #3
mjcarter commentedHi 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
Comment #4
shixish commentedI 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).
Comment #5
okday commentedhi,
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
Comment #6
okday commentedhi,
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
Comment #7
Anonymous (not verified) commentedI am using patch #4 to convert a text (date string) to a date field> perfect!
Thanks.
Comment #9
greggturnbull commented#4 did the trick for me - after conversion, date the variable is now available to set value later in the rule. Well done.
Comment #10
sano commentedWorked for me as well, but only after clearing all caches. Thanks.
Comment #11
mducharme commented#4 works for me as well across multiple strtotime input formats. Excellent addition.