473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Events at Midnight

Hi there,

I need my application to be notified when it's midnight. How can I do
it? (Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio

--
OnAir:
May 18 '07 #1
8 2985
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:eL**************@TK2MSFTNGP02.phx.gbl...
I need my application to be notified when it's midnight. How can I do it?
(Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

That's certainly the way I would do it...

What issue do you have with this...?
--
http://www.markrae.net

May 18 '07 #2
On Fri, 18 May 2007 14:29:49 +0200, Giulio Petrucci
<fa******@fakedomain.comwrote:
>Hi there,

I need my application to be notified when it's midnight. How can I do
it? (Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio
When you application is started, you could calculate remaining
milliseconds until midnight, and then start a timer with that
calculated value.
--
Ludwig
http://www.coders-lab.be
May 18 '07 #3
Hi Mark,

Mark Rae ha scritto:
What issue do you have with this...?
The idea to have a timer polling every minute sounds a bit "stressing"
to me... ;-)
But, really, nothing bad with this approach... I was just hoping there
was some system to "hook" the System clock.

Thanks,
Giulio

--
OnAir:

May 18 '07 #4
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:eL**************@TK2MSFTNGP02.phx.gbl...
Hi there,

I need my application to be notified when it's midnight. How can I do it?
(Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio

--
OnAir:

Has your application anything else to do while waiting for midnight? If not,
just schedule your application to get started at midnight using the system
scheduler.

Willy.

May 18 '07 #5
RSH
I have implemented several of these type of applications to run throughout
the night. I setup Scheduler with a series of Scheduled tasks and it runs
all the reports and then places them on a network drive for access by
everyone who needs them, and even emails them to alert them that the reports
are now there.

Ron
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:A6**********************************@microsof t.com...
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:eL**************@TK2MSFTNGP02.phx.gbl...
>Hi there,

I need my application to be notified when it's midnight. How can I do it?
(Someone suggested me to use a timer rising an event every
minute...please, telle me there is some other way!).

Thanks in advance,
Giulio

--
OnAir:


Has your application anything else to do while waiting for midnight? If
not, just schedule your application to get started at midnight using the
system scheduler.

Willy.

May 18 '07 #6
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:ec**************@TK2MSFTNGP04.phx.gbl...
>What issue do you have with this...?

The idea to have a timer polling every minute sounds a bit "stressing" to
me... ;-)
Why...?
But, really, nothing bad with this approach... I was just hoping there was
some system to "hook" the System clock.
There is - it's called a Timer... :-)
--
http://www.markrae.net

May 18 '07 #7
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:ec**************@TK2MSFTNGP04.phx.gbl...
Hi Mark,

The idea to have a timer polling every minute sounds a bit "stressing" to
me... ;-)
The OS is constantly polling things. All things that are clock-based are on
a poll-for-time basis. Even if the OS offered a time-based hook, internally
it would be a poll-for-time implementation.

Jon
May 19 '07 #8

"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.netwrote in message
news:OK**************@TK2MSFTNGP06.phx.gbl...
"Giulio Petrucci" <fa******@fakedomain.comwrote in message
news:ec**************@TK2MSFTNGP04.phx.gbl...
>Hi Mark,

The idea to have a timer polling every minute sounds a bit "stressing" to
me... ;-)

The OS is constantly polling things. All things that are clock-based are
on a poll-for-time basis. Even if the OS offered a time-based hook,
internally it would be a poll-for-time implementation.

Jon
Could you set up a Scheduled Task to simply run the program at midnight?
May 19 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: GGerard | last post by:
Using Access2000 I have an application that is running 24/7 and I would like this application to perform some routine housekeeping task at midnight. What would be an efficient way of...
4
by: Robert Schoenert | last post by:
I want to be able to subtract two time fields, one starting before midnight and the other past midnight. example: starttime 23:00 and endtime 01:10 The answer is 1:10. How can I do this with...
6
by: Zach | last post by:
I seem to remember that there is a method for establishing time elapsed since midnight, which is it? Thank you. Zach.
2
by: Jordan Richard | last post by:
What would be a good way to ensure that a DataTable, stored in the Cache, gets removed from the Cache every day at midnight? I know I can't assume that it's there - but if it is, I want it to be...
3
by: Amy Smith | last post by:
Hello there, I am having a small problem which been challenging me for few days and need help or advice. I am trying to calculate the day-shift for employees based on the time they started and...
5
by: Jac | last post by:
Hey, I have a windows service and when the day change (so at midnight) I want fire an event so I can execute some code. Do someone has an idea to do that? I don't see directly a solution...
4
by: Chris Shenton | last post by:
I set this up 3 days ago and have not seen any of the logs I've created this way being rotated. I expected them to rotate every midnight. I'm calling the code that uses this logger many times,...
1
by: greg chu | last post by:
Hi, not sure who has done this. I want to set up a time interval that could be pass midnight. so people can enter 8AM to 8AM (pass midnight to 2nd day) 8AM to 2 AM (pass midnight to 2nd day)...
2
by: =?Utf-8?B?YmlsbCB0aWU=?= | last post by:
How is midnight represented in ISO 8601 format? Thank you.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.