Download & Extend

Convert date to string using a date format (and a timezone)

Project:Rules
Version:7.x-2.x-dev
Component:Rules Core
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Hello,

At the moment, convert data can convert a date to a string, but the output can only be a Linux timestamp.
It would be useful to be able to provide a format, and even a timezone, to get a usable string (to put in a mail, display to a user...).
Patch will follow.

David

Comments

#1

Status:active» needs review

Here is the patch.
Feel free to test and give me a feedback.
David

AttachmentSizeStatusTest resultOperations
1898828-1-rules-convert-date2string.patch13.85 KBIdlePASSED: [[SimpleTest]]: [MySQL] 327 pass(es).View details | Re-test

#2

Status:needs review» needs work

My code breaks other actions, such as "Add a variable", but I don't know why yet.
Any help is welcome!

#3

Status:needs work» needs review

Here is a better patch, that does not seem to break anything.

David

AttachmentSizeStatusTest resultOperations
1898828-3-rules-convert-date2string.patch14.08 KBIdlePASSED: [[SimpleTest]]: [MySQL] 327 pass(es).View details | Re-test
nobody click here