Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

what is the easiest way to get date when employee started to work in firm? Now I have data how long employee work, in form yy/mm/dd, example 33/03/14 - this one is working 33 years, 3 months and 14 days. From this I need to get date when he started? If someone have function or stored procedure?

Thanks
Posted

1 solution

Have a look at this: Working with Age: it's not the same as a TimeSpan![^] - it doesn't do exactly what you want, but a simple modification to this constructor:
C#
public Age(DateTime startDate, int years, int months, int days)
    {
    _startDate = startDate;
    _endDate = _startDate.AddYears(years).AddMonths(months).AddDays(days);
    GetAge(_startDate, _endDate);
    }
Or calling it with negative values should do it.
 
Share this answer
 

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