Time Zone Problem

P

Paul

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?
 
M

McKirahan

Paul said:
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)
 
P

Paul

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?
 
M

McKirahan

Paul said:
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?

"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)
 
E

Evertjan.

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.
 
P

Paul

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. said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top