Generally, if you are using a database the expiry date will be stored there. Without knowing more about what you want to achieve its hard to really help but, for example, if you were logging into a website and your password reset date was kept in the database, when you login code can check the current date vs the expiry date and alert you there is a week left, you're overdue, whatever.
muneeb213, don't ask for code if you don't even provide more information. Such as:
where do you save the expirydate (xml, sql database, access database, txt file???)
Also explain more detailed what EXACTLY you want to do.