Click here to Skip to main content
11,578,954 members (65,094 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ADO.NET
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 12-Feb-13 18:52pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


There are many ways to do this.
Simple way is to compare date with today's date and calculate remaining days.
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.

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

  Print Answers RSS
0 Peter Leow 135
1 Frankie-C 115
2 OriginalGriff 113
3 Richard MacCutchan 85
4 Afzaal Ahmad Zeeshan 85
0 OriginalGriff 933
1 Sergey Alexandrovich Kryukov 740
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 419

Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100