There is always the option to use battery (some modern mines use this),for example RAAMS.
The problem is of the enemy know you use only mines that work for max n hours or m days they just wait for n + 1 hours or m + 1 days.
There is a lot more to say about this, but there are probably people way more qualified than be here to explain it.
There are tons of possible options in between n hours and 3 decades