Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9157609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:04:08+00:00 2026-06-17T13:04:08+00:00

My problem: when I combine my Jquery datepicker calendar input and the drop downs

  • 0

My problem: when I combine my Jquery datepicker calendar input and the drop downs I put beside it to capture hours, minutes, and AM/PM I can’t get the proper date to print out.

Here is my php code:

echo protect($_POST['truck_arrive'])." - truck arrive<br>";
echo protect($_POST['truck_arrive_hours'])." - truck arrive hours<br>";
echo protect($_POST['truck_arrive_mins'])." - truck arrive mins<br>";
echo protect($_POST['truck_arrive_ampm'])." - truck arrive ampm<br>";

$truck_arrive_comb = protect($_POST['truck_arrive']).protect($_POST['truck_arrive_hours']).protect($_POST['truck_arrive_mins']).protect($_POST['truck_arrive_ampm']);

echo $truck_arrive_comb." - truck arrive combination<br>";
echo strtotime($truck_arrive_comb)." - truck arrive combination string to time<br>";
echo date("Y-m-d h:i:s",strtotime($truck_arrive_comb))." - truck arrive combination string to time date format<br>";

//$truck_arrive = date("Y-m-d h:i:s",strtotime($truck_arrive_comb));
$truck_arrive = date("Y-m-d h:i:s",strtotime(protect($_POST['truck_arrive'])));
echo $truck_arrive." - truck arrive date format<br>";

and it outputs this:

01/16/2013 - truck arrive
01 - truck arrive hours
04 - truck arrive mins
AM - truck arrive ampm
01/16/20130104AM - truck arrive combination
- truck arrive combination string to time
1969-12-31 07:00:00 - truck arrive combination string to time date format
2013-01-16 12:00:00 - truck arrive date format
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:04:10+00:00Added an answer on June 17, 2026 at 1:04 pm

    This is a simplification of what you can use, just replace hard coded values with appropriate $_POST:

    /* hard coded values for test*/
    $hours=1;
    $minutes=40;
    $am_pm='am';
    
    $hours = $am_pm == 'pm' ? $hours +12 : $hours;
    $dateTime=strtotime('01/16/2013')  ;/* returns seconds*/
    
    $timeInSeconds= ($minutes * 60) + ($hours*3600);
    /* add time in seconds to date in seconds*/
    $totalSeconds= $dateTime + $timeInSeconds;
    
    echo date('Y-m-d H:i:s',$totalSeconds );
    

    WIll need to modify if timezone needs to be considered.

    An alternate approach is to parse the time and date strings into same format as above output and pass that to strtotime() or simply match output that date() creates using the strings

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I'd like to combine the results of a subquery as a text field,
I'll like to combine both my initial problem which leads me to this one
HI there! I've run into some problem while learning to combine .sh files and
Problem: Been struggling to get my code to load external shaders and it is
I am currently using the JQuery plugin Datepicker in my Symfony project with the
Here is a tutorial that indicates how to combine jQuery Form Validation with reCAPTCHA.
I'm looking for a jQuery plugin that can help me with the following: I
I've created a page which combines an inline jQuery UI datepicker . I wan't
I need to combine the power of JavaScript's call() and apply() methods. The problem
so i'm playing around with jquery isotope and trying to combine two options into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.