Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have user validity in database. and I am showing it to admin. so how many validity days are left for any user, that admin should be able to see. so, I want to decrement date as the validity time decreases.
Posted

1 solution

Hi
There are many ways to do this.
Simple way is to compare date with today's date and calculate remaining days.
Example:
Your Validity is of 1 yr and it starts from 1-1-2013 and ends on 1-1-2014.
so you just have to calculate remaining days and show it to the Admin.
like you can get today's date and get days difference from end date by this you will get remaining days.
Hope it will help you.
Try some code for this logic and let me know if error occurs.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900