Solved

Convert Date to Unix Time Stamp

Posted on 2013-01-23
2
533 Views
Last Modified: 2013-01-24
Hi,

I am trying to convert a date to a unix time stamp using the plugin Gravity Form and Sugar Events Calendar.


Using the code below, I am trying to combine the action from here and convert it to a unix time stamp using another action from line 108 from here. But I don't really know what to do.

Any help would be greatly appreciated :)

add_action("gform_pre_submission_2", "pre_submission_handler");
function pre_submission_handler($form){
    $_POST["input_12"] = sc_meta_box_save($post_id);
}

Open in new window

0
Comment
Question by:AccurateDesign
2 Comments
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 38813026
Sorry you have that stumbling block in the way of your success -- it should be simpler.  The conversion is a built-in PHP function, strtotime().  All that other framework stuff is non-value-added when the question is as simple as this.

An article showing how to handle DATE/TIME values is available here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html

Best regards and best of luck with your project, ~Ray
0
 

Author Closing Comment

by:AccurateDesign
ID: 38814384
here is the solution from David Peralty:
"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 "allow populate dynamically" and just for fun I gave it a parameter of timestamp.

Here is what I have in my functions.php file: http://pastebin.com/u7zhZXYV"
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question