How to convert datetime to a integer Unix format for datetime

Check out this topic, it contains the formula you can use: Datetime to unix seconds?