USING THE NEW “CUSTOM DATE OR STRTOTIME VALUE” DATE FUNCTION - Aug 3rd, 2010


Since we can now specify a custom date or strtotime value in date fields, (V2.01) it’s easy to specify a publishDate
or removeDate that is say 4 weeks from the current date. It’s just a bit counter intuitive.

When you first choose “specify custom date (or strtotime value) below” from the default value pull-down menu the box
is filled with something like “2010-01-01 00:00:00" Which you can manually change to choose a custom date and time.

You can modify this date string to choose a custom date and time in the future.

Or you can add a simple relative expression like “+4 weeks” after the modified date string (without the double
quotes) and the date will be set to your modified date + 4 weeks.

To specify a value relative to the current date and time in the field (this is the counterintuitive part). Just delete
the 2010-01-01 00:00:00 and replace it with the “+4 weeks” expression (without the double quotes).

You can use any number that you want to and change “weeks” to “years”, “days”, hours”, “minutes” or
even “seconds” to meet your needs. You should see the new date reflected in the “preview” just under the field.

This only works on newly created records so of course it won't update existing records which must be revised manually.

Or Dave Edis from Interactive Tools suggested:

If you wanted to update the old records you could do that with this command in the MySQL Console (a free plugin):



UPDATE cms_your_table_name SET removeDate = NOW() + INTERVAL 4 week WHERE removeDate = "0000-00-00 00:00:00"



Your table name replaces the text "your_table_name" after the "cms_".

As always, when you’re making these kinds of changes to your on-line database, don’t forget to back up your original
data before you begin.



The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact Interactive Tools for information on the downloading of the software or the purchasing of licenses.


Terms of Service