how to set min and max time for my password in ubuntu terminal

C++
sudo nano /etc/pam.d/common-passwordpassword     [success=1 default=ignore]    pam_unix.so obscure sha512
Source

Also in C++: