Web Service Current Date Problem

Progress2007

Active member
Joined
Sep 5, 2008
Messages
25
Programming Experience
1-3
Hi
I have created a WebService. and my webserver is in Canada. and i am accessing this service from India.

Now problem is that i m not able to get the current time of that system in india.

wht i hv written in Webservice is Now.Date.

and it is not returning the currnet date of system where my webservice is configured.

Please tell me how can i get the current date and time of that system.
 
Is there something wrong with your keyboard ?
written in Webservice is Now.Date
Now.Date returns the date part of local date/time where code is executed. Date.UtcNow is what you need to use to coordinate time between different time zones. With Date you can also convert Utc to local time anywhere if needed.
 
Thanks John for your quick help. but now when i m running it stilll not diving me the right time from local server itself.
Is there something wrong with your keyboard ?

Now.Date returns the date part of local date/time where code is executed. Date.UtcNow is what you need to use to coordinate time between different time zones. With Date you can also convert Utc to local time anywhere if needed.
 
It must be, perhaps their servers clock is set wrong, or perhaps the service is not actually sited where you think?
 
On more suggestion about time retrieved from non-local server: many countries have summer time but many asian countries do not have summer time. Please see my blog at:here which is about last Sunday of the month.
 
Back
Top