MYSQL Recursive query with conditions

Use timegm() instead of mktime()


for those on windows, the below function is available:

_mkgmtime

link for more info: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mkgmtime-mkgmtime32-mkgmtime64