<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Taking data from date field and using it elsewhere in Wordpress</title>
		<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress</link>
		<description>Gravity Support Forums Topic: Taking data from date field and using it elsewhere in Wordpress</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 15:29:43 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress" rel="self" type="application/rss+xml" />

		<item>
			<title>Alex Cancado on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17482</link>
			<pubDate>Wed, 02 Feb 2011 13:54:08 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">17482@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It would be possible using the gform_post_submission hook, but you will need some PHP experience to pull it off. We can recommend a developer if this is something you are willing to pay for.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbdurand on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17479</link>
			<pubDate>Wed, 02 Feb 2011 12:42:08 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">17479@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex, I have Discovered a critical problem : The date of a post (timestamp)&#60;br /&#62;
cannot be set before 1970 in wordpress.&#60;br /&#62;
By consequence using the timestamp date field to enter historical events in the simile timeline is not The right solution there.&#60;br /&#62;
In the simile Timeline wordpress plugin, a widget in the posting page enable to enter dates (start, end...).&#60;br /&#62;
But these fields are not custom type fields, they are recording data into custom database tables.&#60;br /&#62;
Do you think it could be possible to write data directly into database fields from gravity?&#60;/p&#62;
&#60;p&#62;info on the wp simile timeline plugin here:&#60;br /&#62;
Simile timeline plugin : &#60;a href=&#34;http://wordpress.org/extend/plugins/wp-simile-timeline/&#34; rel=&#34;nofollow&#34;&#62;http://wordpress.org/extend/plugins/wp-simile-timeline/&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;http://groups.google.com/group/wp-simile-timeline&#34; rel=&#34;nofollow&#34;&#62;http://groups.google.com/group/wp-simile-timeline&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17391</link>
			<pubDate>Tue, 01 Feb 2011 06:55:04 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">17391@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;functions.php is correct.&#60;br /&#62;
I will need to take a deeper look at this one for you. I will need an admin WP and FTP login to be able to see what is going on. Send them to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbdurand on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17299</link>
			<pubDate>Mon, 31 Jan 2011 08:27:51 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">17299@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;still not working...&#60;br /&#62;
I tried to import the form in another blog with another theme (twentyten) and it still didn't work. the date is 1970.&#60;/p&#62;
&#60;p&#62;I modified the &#34;functions.php&#34; of the theme file and you wrote &#34;function.php&#34;.&#60;br /&#62;
I am wrong here?&#60;br /&#62;
I pasted your code at the end of this functions.php text.&#60;/p&#62;
&#60;p&#62;it's very frustrating...&#60;/p&#62;
&#60;p&#62;I can give you by mail the admin code eventually. something is wrong somewhere...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17294</link>
			<pubDate>Mon, 31 Jan 2011 05:58:10 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">17294@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The first code snippet I sent is the right one.&#60;br /&#62;
It worked for me here. My post ended up with the right date.&#60;br /&#62;
I am not sure why it wouldn't work for you. What you can try to do is switch the date format and see if that makes a difference.&#60;/p&#62;
&#60;p&#62;replace&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;date(&#38;quot;Y-m-d&#38;quot;, strtotime($date));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with ....&#60;/p&#62;
&#60;p&#62;&#60;code&#62;date(&#38;quot;Y-d-m&#38;quot;, strtotime($date));&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;If that still doesn't work, I am out of options.&#60;/p&#62;
&#60;p&#62;Following is the code that worked for me&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_data&#38;quot;, &#38;quot;change_post_date&#38;quot;, 10, 3);
function change_post_date($post_data, $form, $entry){

    //Only change post date on form id 124.
    //NOTE: Replace 124 with your actual form id
    if($form[&#38;quot;id&#38;quot;] != 126)
       return $post_data;

    //NOTE: Replace 3 with your date field id. You can find your field id by inspecting the field&#38;#39;s input tag
    $date = $entry[28];

    $post_data[&#38;quot;post_date&#38;quot;] = date(&#38;quot;Y-m-d&#38;quot;, strtotime($date));
    return $post_data;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>jbdurand on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17286</link>
			<pubDate>Mon, 31 Jan 2011 02:04:55 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">17286@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;hello Alex&#60;br /&#62;
I sent you the exported form by mail
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17280</link>
			<pubDate>Sun, 30 Jan 2011 20:06:16 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">17280@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Lets get this first one working first. Can you send me an export of your form to &#60;a href=&#34;mailto:alex@rocketgenius.com&#34;&#62;alex@rocketgenius.com&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>jbdurand on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17269</link>
			<pubDate>Sun, 30 Jan 2011 13:22:28 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">17269@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex I tried the modification but didn't work. there still might be a date format problem.&#60;/p&#62;
&#60;p&#62;currently in my form the form number is 3, the date number is 28, the input date type is &#34;date field&#34; the date format is &#34;dd/mm/yyyy&#34;&#60;/p&#62;
&#60;p&#62;so I inserted in the following text in function.php : &#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_post_data&#34;, &#34;change_post_date&#34;, 10, 3);&#60;br /&#62;
function change_post_date($post_data, $form, $entry){&#60;/p&#62;
&#60;p&#62;    //Only change post date on form id 124.&#60;br /&#62;
    //NOTE: Replace 124 with your actual form id&#60;br /&#62;
    if($form[&#34;id&#34;] != 3)&#60;br /&#62;
       return $post_data;&#60;/p&#62;
&#60;p&#62;    //NOTE: Replace 3 with your date field id. You can find your field id by inspecting the field's input tag&#60;br /&#62;
    $post_data[&#34;post_date&#34;] = $entry[&#34;28.3&#34;] . &#34;-&#34; . $entry[&#34;28.2&#34;] . &#34;-&#34; . $entry[&#34;28.1&#34;];&#60;br /&#62;
    return $post_data;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;the result is that the posts are sent a today date. not working.&#60;/p&#62;
&#60;p&#62;here is the code of the form for the date input:&#60;/p&#62;
&#60;p&#62;&#38;lt;label class='gfield_label' for='input_3_28'&#38;gt;Date&#38;lt;/label&#38;gt;&#38;lt;div class='clear-multi'&#38;gt;&#38;lt;div class='gfield_date_day ginput_container' id='input_3_28'&#38;gt;&#38;lt;input type='text' maxlength='2' name='input_28[]' id='input_3_28.2' value='' tabindex='2' /&#38;gt;&#38;lt;label for='input_3_28.2'&#38;gt;DD&#38;lt;/label&#38;gt;&#38;lt;/div&#38;gt;&#38;lt;div class='gfield_date_month ginput_container' id='input_3_28'&#38;gt;&#38;lt;input type='text' maxlength='2' name='input_28[]' id='input_3_28.1' value='' tabindex='3' /&#38;gt;&#38;lt;label for='input_3_28.1'&#38;gt;MM&#38;lt;/label&#38;gt;&#38;lt;/div&#38;gt;&#38;lt;div class='gfield_date_year ginput_container' id='input_3_28'&#38;gt;&#38;lt;input type='text' maxlength='4' name='input_28[]' id='input_3_28.3' value='' tabindex='4' /&#38;gt;&#38;lt;label for='input_3_28.3'&#38;gt;YYYY&#38;lt;/label&#38;gt;&#38;lt;/div&#38;gt;&#60;/p&#62;
&#60;p&#62;the other thing is that I will have several gravity forms which should send post with a user modified date.&#60;br /&#62;
so What would be the code for several forms and Date Input Type, date picker, calendar, dd/mm/yyyy?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17258</link>
			<pubDate>Sun, 30 Jan 2011 08:17:56 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">17258@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Yes, there is a problem with the date formatting. I was assuming you were using the single input date field with the calendar.&#60;/p&#62;
&#60;p&#62;Replace the following lines.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$date = $entry[27];

$post_data[&#38;quot;post_date&#38;quot;] = date(&#38;quot;Y-m-d&#38;quot;, strtotime($date));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;with this...&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$post_data[&#38;quot;post_date&#38;quot;] = $entry[&#38;quot;26.3&#38;quot;] . &#38;quot;-&#38;quot; . $entry[&#38;quot;26.1&#38;quot;] . &#38;quot;-&#38;quot; . $entry[&#38;quot;26.2&#38;quot;];&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>jbdurand on "Taking data from date field and using it elsewhere in Wordpress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/taking-data-from-date-field-and-using-it-elsewhere-in-wordpress#post-17253</link>
			<pubDate>Sun, 30 Jan 2011 05:55:43 +0000</pubDate>
			<dc:creator>jbdurand</dc:creator>
			<guid isPermaLink="false">17253@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I enclose the code that I inserted. maybe I did incorrect modifications:&#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_post_data&#34;, &#34;change_post_date&#34;, 10, 3);&#60;br /&#62;
function change_post_date($post_data, $form, $entry){&#60;/p&#62;
&#60;p&#62;    //Only change post date on form id 124.&#60;br /&#62;
    //NOTE: Replace 124 with your actual form id&#60;br /&#62;
    if($form[&#34;id&#34;] != 3)&#60;br /&#62;
       return $post_data;&#60;/p&#62;
&#60;p&#62;    //NOTE: Replace 3 with your date field id. You can find your field id by inspecting the field's input tag&#60;br /&#62;
    $date = $entry[27];&#60;/p&#62;
&#60;p&#62;    $post_data[&#34;post_date&#34;] = date(&#34;Y-m-d&#34;, strtotime($date));&#60;br /&#62;
    return $post_data;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;ps: the date code is now 27 because I tried to create a custom post date field. It didn't work better than the date field
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
