Hi, welcome to the forum.
When you show code, then please show a complete sketch as text between lines with three backslash-single-quotes.
To get an idea of what you have, we need to know more.
What is a sim module ? How is it connected and which library do you use ?
Which Arduino board do you use ?
Can you make a drawing of everything that is connected ?
The DS1302 has a bad and clumsy interface. Some libraries work, some don't. Some modules with a DS1302 have a bad crystal.
Can you use a DS3231 module ?
Some modules are supposed to have a rechargeable battery, but those modules over-charge the batter when used with 5V.
A module with a DS3231 without charging circuit and normal battery is best.