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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:45:46+00:00 2026-06-05T19:45:46+00:00

here is my question: I’ve a website that works only during the night (after

  • 0

here is my question:

I’ve a website that works only during the night (after 21:00 until 24:00)
I have a button that says “Enter”, but i want that button to alert() a message such as 'The website is not available yet'.

But to do so it must check the time so in pseudocode:

    if (time is less more than 21:00 and less than 24:00) {
     return true;
    } else {
      alert('the website is not available yet');
      e.preventDefault;
      return false;
    }

But I don’t understand how I can do that in terms time difference, in any day,
any hint?

thank you guys!

  • 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-05T19:45:48+00:00Added an answer on June 5, 2026 at 7:45 pm
    new Date().getHours()
    

    will return current hour (13 when I am writing this at 13:42). However this solution has several drawbacks:

    • it uses system time, changing the time in the computer will fool your script
    • it uses system time zone, consider getUTCHours()
    • it can be easily bypassed by disabling JavaScript or modifying the script on the fly

    Thus consider fetching time from the server when rendering the page and repeating the test on the server side when user enters (to make sure the check was not bypassed).

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

Sidebar

Related Questions

C# question here.. I have a UTF-8 string that is being interpreted by a
Noob question here! I have an array with hashes that looks like this: arr
Similar question here but this is slightly different... I have two tables that I
First question here: it is a very short yet fundamental thing in Java that
The question here is: If a thread that acquiring an exclusive lock to an
Newbe question here. When I do a mouse-over on a menu item then only
Here is question for all those who have delivered WCF solutions to their clients/customers
Jquery question here. I would like to get the CLASS tag of the only
Newbie question here but for some reason I cant figure this out. I have
Quick question here, i've got a process running that grabs RSS feeds and adds

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.