Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2003, 07:06 PM
Authorized User
 
Join Date: Oct 2003
Location: , , Norway.
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default Time zone trouble!

Hi all,
 I live in Norway, but my web host is outside my timezone. All was well untill today. Now Norway has changed to winter time, and all the posts people make on my site are all 1 hour wrong..
 I've been playing around with the TimeZone and Date Class, but I just don't figure out how to get my date right.. Anybody done this before?


****************MY CURRENT CODE FOR DATE/TIME******
Dim strDate As String = Right("00" & Now.Day, 2) & Right("00" & Now.Month, 2) & Right("00" & Now.Year, 2) & ":" & Right("00" & Now.Hour, 2) & Right("00" & Now.Minute, 2)

------------------------
All help is Good help!
Regards
Michael
__________________
------------------------
All help is Good help!
Regards
Michael
Reply With Quote
  #2 (permalink)  
Old November 2nd, 2003, 12:28 AM
Authorized User
 
Join Date: Jun 2003
Location: Grove City, Ohio, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sempf
Default


Just a thought, but with a little research I bet you could get the CultureInfo.OptionalCalendars property to do some work for you.



Bill Sempf
Effective Visual Studio .NET
Reply With Quote
  #3 (permalink)  
Old January 31st, 2005, 06:05 AM
Registered User
 
Join Date: Jan 2005
Location: New Delhi, New Delhi, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ashoksmohanty Send a message via AIM to ashoksmohanty Send a message via MSN to ashoksmohanty
Default

In this tutorial we will consider our server is located in a different time zone from the one our clients are located at (A London related site is in a server located is USA for example).

First we must know the time in the server. We will create a text file with the code bellow, and we will copy it to our server:

Time in server: <% =time %>


Then we will visit our page and we will get the time in the server. In our case the output is this one

Time in server: 4:37:01 AM

Second, we will calculate the difference in hours between local time and time in server

In our example, in London the time is 10:37:01, so the difference between time in london and in server is six hours.

Finally we will get the code necessary to display the local time by adding 6 hours to server´s time.



Getlocaltime.asp
<%
thehour=Hour(now) + 6 ' Here we will add 6 to hour in server
if thehour>12 then
  thehour=thehour-12
end if
Theminute=minute(now)
if Theminute<10 then
  Theminute="0" & Theminute
end if
Thesecond=second(now)
if Thesecond<10 then
  Thesecond="0" & Thesecond
end if
%>
Local time: <% =thehour %>:<% =Theminute %>:<% =Thesecond %>

Output:
Local time: 10:37:01

Hope this will u.

With Best regards,
Ashok Mohanty



ASJB
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
time zone & day light time rajn ASP.NET 1.0 and 1.1 Professional 0 August 7th, 2007 05:02 PM
adjust zone time kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 July 2nd, 2007 08:53 AM
Zone Time kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 20th, 2006 12:30 PM
getting time zone nerssi Javascript 2 December 22nd, 2004 10:56 AM



All times are GMT -4. The time now is 06:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.