Home > Blockchain >  I have a timestamp and I want to add 100 miliseconds to it
I have a timestamp and I want to add 100 miliseconds to it

Time:02-03

this is a python / pandas data type question.

So lets say I have a timestamp, which is in STRING format: 1675242910384942479

I would like to know the timestamp 100 milliseconds.

Ideally I would like a function take takes in N (number of miliseconds) and timestamp and returns timestamp N.

CodePudding user response:

Since your timestamp is in nanoseconds, you need to add the milliseconds multiplied by 1,000,000

def add_ms(timestamp, ms):
    return int(timestamp)   1000000 * ms
  • Related