Solved

Convert Date to Unix Time Stamp

Posted on 2013-01-23
2
530 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 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now