Click here to Skip to main content
12,501,833 members (53,050 online)
Rate this:
 
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
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2016
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