I have a date in milliseconds since Unix epoch format, how do I substract 5 minutes from it?
Supposing your timestamp is in a variable
This uses arithmetic expansion to subtract 5 lots of 60 (seconds in a minute) lots of 1000 (milliseconds in a second) from your value |
|||||||||||||
|
5 minutes of 60 seconds of 1000 milliseconds each gives 300000. You can subtract this from a variable that containts current date in milliseconds using
The milliseconds calculation comes from this answer |
|||||
|
There are too many ways:
or
or
etc... |
|||||
|
print solaris sun os minus 10min
|
|||||
|