Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert Date to Unix Time Stamp

Posted on 2013-01-23
2
Medium Priority
?
537 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1500 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

688 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