PHP strtotime
gives unix timestamp, but how to get the nanosecond timestamp in unix epoch. I want to get it to store it in my influxdb.
PHP does not provide a function that has higher precision than microseconds, unfortunately. The UNIX timestamp, according to the standard, is stored in microseconds.
However, there is a platform-dependent solution. Use
system('date %N');
on a linux machine. See man date or this page for more info.