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

  • Home
  • SEARCH
  • 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 9165909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:01:18+00:00 2026-06-17T15:01:18+00:00

I got 3 numeric text fields which are days, hours and min. I have

  • 0

I got 3 numeric text fields which are days, hours and min. I have scripted in such a way that user can only type 2 digit for each field.

Can someone help me to combine this 3 fields into one integer (which is a UNIX time) so that I can save it in the database as a single column time.

HTML

<table><tr>
<td><input id='days' type='text' maxLength='2' placeholder='Days'></td>
<td><input id='hours' type='text' maxLength='2' placeholder='hours'></td>
<td><input id='min' type='text' maxLength='2' placeholder='Min'></td>
</tr></table>

JavaScript

var day = document.getElementById('days').value;
var hours = document.getElementById('hours').value;
var min = document.getElementById('min').value;

How do I combine this 3 variable (day,hours,min) into one single unix time variable and save it in the database. ( I know how to save it in the database but ? How do I combine the 3 variable and save it in a single JavaScript variable ? )

  • 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-17T15:01:19+00:00Added an answer on June 17, 2026 at 3:01 pm

    For this, I’m using you want to use the current month and year? You need to post the fields to your PHP script and use strtotime to formulate a timestamp:

    $timestamp = strtotime(date('Y-M') . '-' . $_POST['days'] . ' ' . $_POST['hours'] . ':' . $_POST['min']);
    

    Or, using JavaScript:

    var d = new Date();
    var ts = Math.round((new Date(d.getFullYear(), d.getMonth(), $('#day').val(), $('#hours').val(), $('#min').val())).getTime() / 1000);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a couple of text boxes that accept numeric values. When a user
I've got a varchar column that I want to sort numeric, which works great
I've got a table which have a column describing a numeric ID, which is
Got a seg fault from my memcpy that gdb can't give me anything else
I have got a return from a server which is a block of html,
I've got a string of text that becomes part of the filename that gets
I have a numeric field in my report that I perform the operation Time({Command.EndTime}/60,Remainder({Command.EndTime},60),0)
I've got a double which I'm trying to save to a postgres numeric column.
Now that I have managed to shift my text while writing, I want to
I have a vertical layout of 4 Edit Text numeric inputs and 4 Radio

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.