Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
hi guys,

can anyone help me on how to allow user can do data entry only from 12:01 AM to 11:59 PM..

thanks,
musiw.
Posted
Comments
ZurdoDev 22-Oct-13 7:39am    
Sure. Let them run the app.
ZurdoDev 22-Oct-13 7:40am    
This does not make any sense unless I am dyslexic. You want to allow the user to run only from 12:01 AM to 11:59 PM. So, you are saying there is only 1 second in the day where they can't run it?
Pheonyx 22-Oct-13 8:22am    
I think he is trying to exclude ~2 minutes in every day for some reason, I.e. 11:59.01 -> 12:01.00
ZurdoDev 22-Oct-13 8:27am    
Ah, you're right. Still weird though.
Pheonyx 22-Oct-13 8:30am    
Agreed, The only reason I can see for wanting to achieve this is if there is some major processing going on during those two minutes on the database server?

1 solution

Sure,

In pseudo code you do this:

StartDate = New Date (Todays Date, 00:01)
EndDate = New Date (Todays Date, 23:59)

If DateTime.Now is not between StartDate and EndDate then Disable Data Entry
 
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