Click here to Skip to main content
15,890,390 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
For AFF Course

Commencing Time 13.30
Present Time 13.15

Kindly be intimated that the classes commencing from 13.30 hrs and you are required to be present here by 1315 hrs.


I want if Course Commencing Time is 13.30 means automatically i want to set Present time is 13.15.

I want to reduce 15 Minutes from Commencing Time.
for that how can i do using c#.

Regards,
Narasiman P.
Posted
Comments
Sergey Alexandrovich Kryukov 4-Nov-14 1:14am    
Not clear.
syed shanu 4-Nov-14 1:15am    
so what is your problem.Do you get time from DB or you get current system Time from your code.
murkalkiran 4-Nov-14 1:19am    
sorry not clear question
syed shanu 4-Nov-14 1:20am    
In c# you can use "AddMinutes" to add or subtract mininutes from your dateTime,
For Example :
DateTime CurrentDateandTime = DateTime.Now;

DateTime FifteenMinLess = DateTime.Now.AddMinutes(-15);
Sinisa Hajnal 4-Nov-14 1:59am    
So, what is the problem here?

1 solution

Use DateTime.AddMinutes(-15);

CommencingTime.AddMinutes(-15)

You CommencingTime variable MUST be a datetime.
 
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