This topic contains 7 reply and 2 voices, and was last updated by towhid 5 years ago
Viewing 7 Posts - 1 through 7 (of 7 total)
Author Posts
November 11, 2014 at 10:10 am 30168
towhid Hello, Great plugin! I need to use the Frontend Pro date picker to pass unix time to the database. But Id still like the user to see the date selected in a human formant i.e. 12/12/14 The reason I need this is because Im using EventON Calendar plugin and their custom field for the start_date is in Unix code. How can I achieve this with Frontend Pro? Thanks
November 11, 2014 at 1:03 pm 30182
robbie59 robbie59

How can I use this action hook, function…..?

// CREATE UNIX TIME STAMP FROM DATE PICKER
function custom_unixtimesamp ( $post_id ) {
if ( get_post_type( $post_id ) == ‘events’ ) {
$startdate = get_post_meta($post_id, ‘startdate’, true);

if($startdate) {
$dateparts = explode(‘/’, $startdate);
$newdate1 = strtotime(date(‘d.m.Y H:i:s’, strtotime($dateparts[1].’/’.$dateparts[0].’/’.$dateparts[2])));
update_post_meta($post_id, ‘unixstartdate’, $newdate1 );
}
}
}
add_action( ‘save_post’, ‘custom_unixtimesamp’, 100, 2);

November 11, 2014 at 1:22 pm 30184
towhid towhid

Hello Robbie59,

Please type single character ‘y’ then it will work. Please let me know if you have any complexity.

Thank You. 🙂

November 11, 2014 at 1:28 pm 30185
robbie59 robbie59

Thanks, but that did not work.

When I use the date field,with meta value as “start_date” I get this: 2014/11/25 00:00:00

I need the date to converted to unix date.
Something like this: 1416531600

I need this to work really bad

November 11, 2014 at 1:30 pm 30187
robbie59 robbie59

Are you talking about the hook? I never got that to work..

November 11, 2014 at 2:33 pm 30193
towhid towhid

Hello Robbie59,

From the back-end please type single character “dd/mm/y” in Date Format field hope it will work. Please let me know if you have any complexity.

Thank You. 🙂

November 11, 2014 at 9:04 pm 30228
robbie59 robbie59

Thanks,

I did your suggestion and the format printed as 11/20/14.

I need it so save to the database in unix format. i.e.: Something like this: 1416531600

November 12, 2014 at 12:24 pm 30263
towhid towhid

Hello Robbie,

Currently we do not have any function in unix format. But you can do you own, Please follow this manual http://php.net/manual/en/function.date.php.

Thank You. 🙂

Viewing 7 Posts - 1 through 7 (of 7 total)