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

249
Views
having trouble figuring one-line datetime calculation

im attempting to create a python script that log into local server via http request but it requires local time but i think its encrypted but not sure example: 2022.08.07.01.09.59 = 1659823799756 i took a look at the js code

 function getDuration(time) {
    let duration = 0;
    if (time.seconds) {
        duration += time.seconds * 1000;
    }
    if (time.minutes) {
        duration += time.minutes * 60 * 1000;
    }
    if (time.hours) {
        duration += time.hours * 60 * 60 * 1000;
    }
    if (time.days) {
        duration += time.days * 24 * 60 * 60 * 1000;
    }
    return duration;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It is not encrypted, it is the epoch / unix timestamp, which is the number of seconds since January 1, 1970 12:00:00 AM GMT. It can also be expressed in number of milliseconds (your case).

In Python you can get it with time.time(), to get the millis multiply it by 1000. If you need an integer value you have to round it, because time.time() returns a float.

timeMillis = int(round(time.time() * 1000))

See this link for the current Epoch in millis and for converters https://currentmillis.com/

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!