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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:07:45+00:00 2026-05-18T02:07:45+00:00

I am trying to calculate the current second in the current month, but I’m

  • 0

I am trying to calculate the current second in the current month, but I’m having trouble creating a simple function that does it.

My best guess involves using getTime() – the current milliseconds since January 1 1970 – and then subtracting X, where X is the number of milliseconds up to the end of the previous month.

Can you help me think of a better way to do this?

Thank you very much for your help.

Cheers,

  • 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-18T02:07:45+00:00Added an answer on May 18, 2026 at 2:07 am
    function() {
      var now = new Date().getTime(),
          monthStart = new Date();
    
      monthStart.setDate(1);
      monthStart.setHours(0);
      monthStart.setMinutes(0);
      monthStart.setSeconds(0);
      monthStart.setMilliseconds(0);
      return Math.floor((now - monthStart.getTime()) / 1000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out the best way to calculate a value that is
I'm having trouble trying to calculate a running total from within a CASE statement.
I' trying to use window.pageYOffset & window.scrollMaxY to calculate the current page progress. This
I'm trying to calculate the number of success cases within a recursive function in
I am trying to calculate last years starting day of the current week NOW()
I'm trying to calculate the smallest difference between two angles. This is my current
I am trying to calculate the forces that will act on circular objects in
I'm trying to generate some sql that is used to calculate some final scores
I'm trying to calculate the difference between 2 dates, the current date and the
I am trying to calculate the nearest Age based on DOB, but i cant

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.