Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Chrome Extension date and time not updated when extension working

I am making extension. I get date and time with "getDateAndTime();" function.

function getDateAndTime() {
return (date.getDate()<10? "0" : "") + date.getDate() + " " + months_tr[date.getMonth()] + " " + date.getFullYear() + " - " + (date.getHours()<10? "0" : "") + date.getHours() + "." + (date.getMinutes()<10? "0" : "") + date.getMinutes(); 
}

The first time the extension runs, the date and time are updated, but then when the function is called again, the data is not updated.

How can I keep the date and time up to date?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have a date variable that declared out of the function. It's declared once so it will remain the same.

I guess you want to add:

function getDateAndTime() {
    const date = new Date();
    ....
}

It means that the date is updated for everyone calls this function.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!