Skip to main content
Inspiring
May 30, 2007
Question

Classic ASP - Server Time Difference

  • May 30, 2007
  • 5 replies
  • 667 views
Hi All.

My hosting company's servers are 7 hourse behind UK time.
Is there a way to get my Access Database to adjust the time before it
inserts a TimeStamp?
I'm using now() at the moment for the default value

If this can't be dont in the database, what ASP code would i use to display
the correct date/time?

Thanks in Advance
Andy





This topic has been closed for replies.

5 replies

Inspiring
June 1, 2007
Thanks Joe

That did it :-)

Andy


"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns994246C72F8A5makowiecatnycapdotrE@216.104.212.96...
> On 01 Jun 2007 in macromedia.dreamweaver.appdev, Andy wrote:
>
>> if i can't change the timestamp in the Access database, then i need
>> some code that displays the time/date but minus 7 hours.
>>
>> Any idea how id do that?
>> I have this at the moment, but it takes 7 days off
>>
>> <%=(ContentRS.Fields.Item("TimeStamp").Value)(-7)%>
>
> How about dateadd()?
>
> <%= dateadd("h", -7, (ContentRS.Fields.Item("TimeStamp").Value)) %>
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/contact.php


Inspiring
June 1, 2007
On 01 Jun 2007 in macromedia.dreamweaver.appdev, Andy wrote:

> if i can't change the timestamp in the Access database, then i need
> some code that displays the time/date but minus 7 hours.
>
> Any idea how id do that?
> I have this at the moment, but it takes 7 days off
>
> <%=(ContentRS.Fields.Item("TimeStamp").Value)(-7)%>

How about dateadd()?

<%= dateadd("h", -7, (ContentRS.Fields.Item("TimeStamp").Value)) %>

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php
Inspiring
June 1, 2007
Thanks Guys
if i can't change the timestamp in the Access database, then i need some
code that displays the time/date but minus 7 hours.

Any idea how id do that?
I have this at the moment, but it takes 7 days off

<%=(ContentRS.Fields.Item("TimeStamp").Value)(-7)%>

Thanks
Andy

"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns99408275BDBE7makowiecatnycapdotrE@216.104.212.96...
> On 30 May 2007 in macromedia.dreamweaver.appdev, Andy wrote:
>
>> My hosting company's servers are 7 hourse behind UK time.
>> Is there a way to get my Access Database to adjust the time before
>> it inserts a TimeStamp?
>> I'm using now() at the moment for the default value
>>
>> If this can't be dont in the database, what ASP code would i use to
>> display the correct date/time?
>
> Somebody more familiar with Access will have to comment, but (as far as I
> know) a timestamp column takes the system time on insert (and maybe
> update), and you can't change that.
>
> What you could do is adjust the time when you use the values:
>
> adjustedTime = dateadd("h", 7, timeFromDatabase)
>
> http://www.drdev.net/article05.asp
> http://www.google.com/search?q=time+arithmetic+asp+vbscript
> http://www.google.com/search?q=time+arithmetic+access
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/contact.php


Inspiring
May 30, 2007
On 30 May 2007 in macromedia.dreamweaver.appdev, Andy wrote:

> My hosting company's servers are 7 hourse behind UK time.
> Is there a way to get my Access Database to adjust the time before
> it inserts a TimeStamp?
> I'm using now() at the moment for the default value
>
> If this can't be dont in the database, what ASP code would i use to
> display the correct date/time?

Somebody more familiar with Access will have to comment, but (as far as I
know) a timestamp column takes the system time on insert (and maybe
update), and you can't change that.

What you could do is adjust the time when you use the values:

adjustedTime = dateadd("h", 7, timeFromDatabase)

http://www.drdev.net/article05.asp
http://www.google.com/search?q=time+arithmetic+asp+vbscript
http://www.google.com/search?q=time+arithmetic+access

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php
Inspiring
May 30, 2007
DateAdd("h",-7,Now())

Subtracts 7 hours from whatever time is reported by the Now() function.


"Andy" <andy@work.com> wrote in message
news:f3k5f9$992$2@forums.macromedia.com...
> Hi All.
>
> My hosting company's servers are 7 hourse behind UK time.
> Is there a way to get my Access Database to adjust the time before it
> inserts a TimeStamp?
> I'm using now() at the moment for the default value
>
> If this can't be dont in the database, what ASP code would i use to
> display the correct date/time?
>
> Thanks in Advance
> Andy
>
>
>
>
>