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 6563009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:46:40+00:00 2026-05-25T13:46:40+00:00

I am creating a Javascript based date filter to filter files, which has date_created

  • 0

I am creating a Javascript based date filter to filter files, which has date_created metadata.
I wish to create that date filter as a range slider with max/min (are static) and current selection. For this going to use jQuery UI slider component. Visible output has to be always in a format dd/mm/yyyy and I will show it for min/max and from/to range selectors.

While developing, I came to a question, which format I have to use on a hidden part to make steps inside the slider. Each step has to be 1 day. I decided to try with unix on hidden side. So I can easily convert unix into dd/mm/yyyy with my Javascript function:

function unixToDate(timestamp){
  var date = new Date(timestamp * 1000);
  var d = date.getDate(),
      m = date.getMonth() + 1,
      y = date.getFullYear();
  return d + "/" + m + "/" + y;
}

And this function works well for me, however if step == 1day, I need 1 day value in unix to make addition (+) and subtraction (-) when user moves slider.
So which is that value of 1 day in unix, which I can add or subtract to when changing range?

Or any other alternatives to make date filter as slider…

  • 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-05-25T13:46:41+00:00Added an answer on May 25, 2026 at 1:46 pm

    One day is equal to currentTimeInUnixTime+(60*60*24)
    That is because Unix time is simply the seconds since the beginning of epoch. 60 seconds make one minute. 60 minutes make an hour. And 24 hours make a day. Multiply them all, and add them to the current Unix time you have to get the Unix time for the next day.

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

Sidebar

Related Questions

I'm creating a Drupal form with a datetime-based javascript popup calendar input that allows
I'm creating a JavaScript based calendar control, which when showing a single day needs
I am creating a platform game in JavaScript using canvas which is entirely tile-based.
I'm creating some JavaScript, mainly jQuery based widgets that are suppose to work on
I'm creating my own JavaScript Array-like object and I have methods that call closures.
I know that in JavaScript, creating a for loop like this: for(int i =
I'm creating an advent calendar and I need a piece of jQuery/Javascript that will
I have a javascript-based client that is currently polling a .NET web service for
What is the best way to go about creating javascript classes so that objects
I have a site that is heavily based on javascript, but I still want

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.