Yes in a way a black hole can act as a time machine. Now, a black hole is just a star like our sun. Our sun is an average star. In a way that our sun works is fact that is ball of hydrogen gas and the gravity of gas is colliding the hydrogen atoms together. As the hydrogen atoms collide together they form helium atoms and there is a little difference between the mass of helium and hydrogen atoms. That little difference in mass results in light and heat in the form of energy. But eventually what will happen is that this internal furnace will begin to get used up and when that happens the gravity of the star that pushes the star inward will not going to be balanced by the internal energy that’s pushing it outward and the star is going to collapse.
A black hole is just simply a star collapsed at such a point that light that tries to escape is pulled back towards it due to the massive gravity. So you see a black spherical object out there. It turns out that the massive gravity of black hole not just only effect light but time also.
If you take a clock and you are moving closer and closer to the black hole, you will find that time is actually starting to slow down. So if you somehow get to the edge of the black hole the time will come nearly to a halt, as a human being if you are getting closer your heart rate will start to slow down and you will age less than everyone else.
You could be near a black for few hours and decade could be passing for everyone else. When you move away from the black hole you will find yourself in the future.