<?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: Date field to custom post date field problem (from date to unix)</title>
		<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix</link>
		<description>Gravity Support Forums Topic: Date field to custom post date field problem (from date to unix)</description>
		<language>en-US</language>
		<pubDate>Thu, 30 Apr 2026 08:20:51 +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/date-field-to-custom-post-date-field-problem-from-date-to-unix" rel="self" type="application/rss+xml" />

		<item>
			<title>Richard on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-130406</link>
			<pubDate>Thu, 24 Jan 2013 11:14:18 +0000</pubDate>
			<dc:creator>Richard</dc:creator>
			<guid isPermaLink="false">130406@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I tried something like this and it doesn't work. For testing purposes, I am trying to send the unix time stamp to the content editor but nothing is showing up.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
add_action(&#34;gform_pre_submission_2&#34;,&#34;convert_field_date&#34;);&#60;br /&#62;
function convert_field_date($form){&#60;br /&#62;
$_POST[&#34;input_22&#34;] = strtotime($_POST[&#34;input_14&#34;]);&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-69285</link>
			<pubDate>Fri, 03 Aug 2012 09:06:19 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69285@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So here is what I did.&#60;/p&#62;
&#60;p&#62;I have a field called Time Stamp. I gave it the CSS class of hidden. I added .hidden { display: none; } to my style.css. I checked off &#34;allow populate dynamically&#34; and just for fun I gave it a parameter of timestamp.&#60;/p&#62;
&#60;p&#62;Here is what I have in my functions.php file&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission_30&#38;quot;,&#38;quot;convert_field_date&#38;quot;,10,2);
function convert_field_date($form){
$_POST[&#38;quot;input_2&#38;quot;] = strtotime($_POST[&#38;quot;input_1&#38;quot;]);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-69284</link>
			<pubDate>Fri, 03 Aug 2012 09:01:01 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">69284@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I see you are using the Post Submission hook. Why is that? Also, where is $converted going once it is returned? Lastly, a date field in Gravity Forms can only accept date strings, so if you try to push a unix time stamp back, it will fail/not-work. &#60;/p&#62;
&#60;p&#62;An input field could take a Unix Time stamp though. So you could have a hidden custom field form field. Grab the date selected on the gform_pre_submission hook, convert it to a time stamp, and then push it to the hidden custom field in your form. Then you would have a custom field with a Unix time stamp.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexktin on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-69271</link>
			<pubDate>Fri, 03 Aug 2012 03:47:38 +0000</pubDate>
			<dc:creator>alexktin</dc:creator>
			<guid isPermaLink="false">69271@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Chris&#60;/p&#62;
&#60;p&#62;The code isn't long so I hope you don't mind I decided to paste it here.&#60;/p&#62;
&#60;p&#62;add_action('gform_post_submission_1', 'convert_field_date', 10, 2);&#60;/p&#62;
&#60;p&#62;function convert_field_date($date_field, $converted, $entry){&#60;br /&#62;
	$date_field = $entry['5'];&#60;/p&#62;
&#60;p&#62;	$converted = strtotime($date_field);&#60;br /&#62;
	 return $converted;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;Please take a look and let me know if you have any suggestions. Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-68414</link>
			<pubDate>Sun, 29 Jul 2012 02:18:33 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">68414@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you post the code you tried at pastebin.com or pastie.org - we'll be happy to take a look at how you're doing it.  Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alexktin on "Date field to custom post date field problem (from date to unix)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/date-field-to-custom-post-date-field-problem-from-date-to-unix#post-68174</link>
			<pubDate>Fri, 27 Jul 2012 06:17:49 +0000</pubDate>
			<dc:creator>alexktin</dc:creator>
			<guid isPermaLink="false">68174@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Good day&#60;/p&#62;
&#60;p&#62;I am trying to submit a date from a form to a custom post type that has a post date field. Unfortunately the date always gets posted as 1/1/1970. I am using the WP Types plugin for the custom posts. When submitting the date through the dashboard everything seems fine, but as soon as I use a from to submit the date it gets posted as 1/1/1970.&#60;/p&#62;
&#60;p&#62;I have read somewhere on the forums that WP Types uses a Unix time stamp and that one has to write a function to convert the date that was entered in the form to a Unix time stamp.&#60;/p&#62;
&#60;p&#62;I have tried different variations of actions and filters to write this function but just cannot get it right. Can someone please be so kind as to assist me in this matter?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
