Solved

Convert Date to Unix Time Stamp

Posted on 2013-01-23
2
535 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 110

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Insert Event into Google Calendar using PHP and Google Calendar API 1 52
wordpress theme 8 36
Insert PHP into HTML page. 7 43
Prestashop modules custimzation 2 20
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

738 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