can anyone please tell me how do i get the date/time of the web server hosting the website... i know the function Now() get the client side time.. but what if i wan the server-side time... please help...Have a look at this (http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock)
but that is in javascript.. what if my page language is in vb???
can i find out whether there is any code which will display the GMT of the client.. ex: my gmt is +8 so when my computer request from the server it should display GMT+8...
DateTime.Now does not give client time. It will give you the server time.
To get the time zone of the client, you need to use javascript.
var d = new Date();
alert(d.getTimezoneOffset());
sorry when it come to prgramming for time i am quite a noob..u mind give me the full syntax for DateTime.Now ??
u mind give me the full syntax for DateTime.Now ??
DateTime.Now
Yes, that is the syntax. To display it, you can use
DateTime.Now.ToString()
or
DateTime.Now.ToShortDateTimeString()
and other available methods which should be visible to you in the intellisense.
Showing posts with label date. Show all posts
Showing posts with label date. Show all posts
Wednesday, March 28, 2012
web service
Hi
I got to create a system that automatically sends out an email when the server date is equal to a date field in an sql server database. The project I am working has been built using asp but I can't find a solution using classic asp. I'm relatively new to asp.net and thought maybe using a .net web service to provide this functionality. Can anyone advise me of a way to do this asp or asp.net and whether I was on the right track with the web service idea?
I got to create a system that automatically sends out an email when the server date is equal to a date field in an sql server database. The project I am working has been built using asp but I can't find a solution using classic asp. I'm relatively new to asp.net and thought maybe using a .net web service to provide this functionality. Can anyone advise me of a way to do this asp or asp.net and whether I was on the right track with the web service idea?
Thanks in advance.Hi,
You don't require a webservice for this. Instead you can create a console application using c# or vb.net which will be an exe that will run daily at a specified time and check if the server date is equal to that in the database and then send out a mail, if it is equal.
Once you are done with the logic, you can put it in task scheduler (type tasks form command prompt) for the same to run daily.
Hope it helps.
Subscribe to:
Comments (Atom)