473,499 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Time Zone Problem

Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the database
automatically adds date and time which is fine. My only problem is that my
site is for the GMT UK time zone, but the database resides on a American
server, IE the database records the local American time (-5 hours
difference)
and not the time of the users using it in the UK.

Is there anyway to round this?
Jul 22 '05 #1
5 2114
"Paul" <de*******@blueyonder.co.uk> wrote in message
news:8X*******************@fe1.news.blueyonder.co. uk...
Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the database automatically adds date and time which is fine. My only problem is that my
site is for the GMT UK time zone, but the database resides on a American
server, IE the database records the local American time (-5 hours
difference)
and not the time of the users using it in the UK.

Is there anyway to round this?


Presuming that your using "Now" to set the time; try:

Dim strNOW
strNOW = DateAdd("h",-5,Now)
Jul 22 '05 #2
Thanks for that. The database was originally set up with two fields which
automatically defaulted to the current time and date, so there was no time
or date sent from the web page. I have had a look at DateAdd and Now
statement, but I really wanted to put time and date in two separate fields.
Q. Are there two separate statements to give me current date and current
time?
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:uP********************@comcast.com...
"Paul" <de*******@blueyonder.co.uk> wrote in message
news:8X*******************@fe1.news.blueyonder.co. uk...
Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the

database
automatically adds date and time which is fine. My only problem is that
my
site is for the GMT UK time zone, but the database resides on a American
server, IE the database records the local American time (-5 hours
difference)
and not the time of the users using it in the UK.

Is there anyway to round this?


Presuming that your using "Now" to set the time; try:

Dim strNOW
strNOW = DateAdd("h",-5,Now)

Jul 22 '05 #3
"Paul" <de*******@blueyonder.co.uk> wrote in message
news:uE*******************@fe1.news.blueyonder.co. uk...
Thanks for that. The database was originally set up with two fields which
automatically defaulted to the current time and date, so there was no time
or date sent from the web page. I have had a look at DateAdd and Now
statement, but I really wanted to put time and date in two separate fields. Q. Are there two separate statements to give me current date and current
time?
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:uP********************@comcast.com...
"Paul" <de*******@blueyonder.co.uk> wrote in message
news:8X*******************@fe1.news.blueyonder.co. uk...
Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the

database
automatically adds date and time which is fine. My only problem is that
my
site is for the GMT UK time zone, but the database resides on a American server, IE the database records the local American time (-5 hours
difference)
and not the time of the users using it in the UK.

Is there anyway to round this?


Presuming that your using "Now" to set the time; try:

Dim strNOW
strNOW = DateAdd("h",-5,Now)


"Date" and "Time"

However, if your script ran at exactly midnight there could be a problem as
the
Date might indicate one day and the Time the day after (if you follow me).

Dim strNOW
strNOW = DateAdd("h",-5,Now)
Dim strDAT
strDAT = FormatDateTime(strNOW,vbShortDate)
Dim strTIM
strTIM = FormatDateTime(strNOW,vbLongTime)

Jul 22 '05 #4
Paul wrote on 13 apr 2005 in microsoft.public.inetserver.asp.general:
Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the
database automatically adds date and time which is fine. My only
problem is that my site is for the GMT UK time zone,
You are in trouble because now [summertime] yher is a difference of 1
hour beween GMT and BST.

but the database
resides on a American server, IE the database records the local
American time (-5 hours difference)
That depends on the timezone in the US and the date since the
summertimetime, called daylight saving time on that side of the big pond,
switchese at a different date and time.
and not the time of the users using it in the UK.

Is there anyway to round this?


Sure, I use for the difference of Toronto [server]
and Central European time [user]:

nu = DateAdd("h", 6, Now)
If nu>#2005-03-27 02:00# then nu = DateAdd("h", 7, Now) 'CET switch
If now>#2005-04-04 02:00# then nu = DateAdd("h", 6, Now) 'Toronto switch

nu holds CET.

You will have to fill the switch date and times with data for the next
switch.

European times [WET=BST, CET, EET] all switch at 0100 GMT(!)
American times switches at a local 0200, if at all.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #5
Thanks Evertjan and McKirahan, your help was very much needed and your
suggestions are being implemented as we speak. Once again thank you.

Paul.
In the dark I sometimes fall over.
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Paul wrote on 13 apr 2005 in microsoft.public.inetserver.asp.general:
Hi All, I know this is probably simple, but I'll ask anyway.
I have a form which when submitted to the database the field in the
database automatically adds date and time which is fine. My only
problem is that my site is for the GMT UK time zone,


You are in trouble because now [summertime] yher is a difference of 1
hour beween GMT and BST.

but the database
resides on a American server, IE the database records the local
American time (-5 hours difference)


That depends on the timezone in the US and the date since the
summertimetime, called daylight saving time on that side of the big pond,
switchese at a different date and time.
and not the time of the users using it in the UK.

Is there anyway to round this?


Sure, I use for the difference of Toronto [server]
and Central European time [user]:

nu = DateAdd("h", 6, Now)
If nu>#2005-03-27 02:00# then nu = DateAdd("h", 7, Now) 'CET switch
If now>#2005-04-04 02:00# then nu = DateAdd("h", 6, Now) 'Toronto switch

nu holds CET.

You will have to fill the switch date and times with data for the next
switch.

European times [WET=BST, CET, EET] all switch at 0100 GMT(!)
American times switches at a local 0200, if at all.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jul 22 '05 #6

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

Similar topics

11
4616
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
2
6757
by: Jason Priebe | last post by:
I'm a bit confused about SET TIME ZONE and its effect on PostgreSQL's date processing. In my experience with timestamps in all other *nix-based software systems, a timestamp is always a numeric...
0
1702
by: Jason Priebe | last post by:
I posted earlier with a very complex example. This simple one gets to the point much faster. timeofday() seems to behave inconsistently when the timezone is set with "GMT+X" notation. foo=>...
3
35033
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
2
24606
by: Avi | last post by:
I have a problem to get the different time zone's name for example I need the name of time zone UTC + 4:30 ("Kabul") The TimeZone.CurrentTimeZone get my current time zone name and I couldn't...
4
6400
by: brfin999 | last post by:
Server time zone 1 hour different from Client time zone. .Net 1.1 c# Win Forms app: actual date 9/25/04 displays 9/24/04 11:00 PM. When I change client time zone to equal server time zone, date...
1
2305
by: Clodoaldo Pinto Neto | last post by:
Hi all, I want to have the time zone string (like 'BRT') displayed after a date-time. The date column is of the type timestamp with time zone. But the time zone is not displayed. It works for...
14
2621
by: Cesar Ronchese | last post by:
Hello! I've built a program that show some dates to users. I got a problem when users have different configured time zone machines, where: - One machine that determined time zone the date...
2
14672
by: Mike | last post by:
I'm writing an application for Windows XP Embedded. This application requires that the user be able to change the time zone from within the application. I'm trying to do this using...
3
2724
by: Satish Itty | last post by:
Hi all, I have a big problem in my hands and not sure how I can fix this. Any suggestions would be greatly appreciated. I have a .NET 3 tier app developed in VS2003 and .NET 1.1. the client is a...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
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...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.