Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 26th, 2003, 04:17 PM
tiredstudent tiredstudent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Wichita, KS
Posts: 3 tiredstudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Now() Date/Time Not Correct -- Better way??

I'm currently building an simple database connection page for entry and viewing. I have one field that, rather than using ASP code, I was using a Default Value of 'Now()' in the Microsoft Access database to store the current date and local time for a record; however, now that the application is on a server in a different time zone, it's not displaying the correct time (to me, that is two zones away).

Is there a better way to "date stamp" a record when you record it into a database?

Thanks!

-dl

David R. Longnecker
CCNA, MCSA, Network+, A+

URL

Reply With Quote
  #2  
Old October 26th, 2003, 07:32 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 23 m 39 sec
Reputation Power: 181
You could try storing a timezone offset with user accounts, and convert the server's time to the user's time when displaying pages.

Reply With Quote
  #3  
Old October 26th, 2003, 08:50 PM
tiredstudent tiredstudent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Wichita, KS
Posts: 3 tiredstudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The database currently does not have a username or password (at this time, still testing); however, I'm not sure (if that's even what you mean) how to link the authentication to a time zone. Would I have a username and timezone for each viewer and then store the time zone, upon login, to a variable?

e.g. user1 = cst (+2)

This will be a ticket system that does not require authentication, the base, as I learn the in's and out's is just a guestbook for my personal web site. I didn't plan on creating user accounts for that.

I had previously considered just storing the time into a variable and assigning it, but I couldn't get it to work and it was recommended just setting the same variable (Now) in the database. Could I assign it to a variable, and if so, how can I prevent SQL from freaking out when it sees it?

I had:

strCurrentDateTime = <%=Now() %>

strSQL ... blah.. VALUES "strCurrentDateTime", blah..

It seemed to balk at this.

Reply With Quote
  #4  
Old October 26th, 2003, 08:55 PM
tiredstudent tiredstudent is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Wichita, KS
Posts: 3 tiredstudent User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If it'd help, the "beta" pages are at:

URL

and

URL

No frills, just core database stuff, for now.

Thanks!!

-David

Reply With Quote
  #5  
Old October 27th, 2003, 09:49 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
MS Access needs "#" Symbol surrounding a Date/Time variable for it to know that the variable holds a Date value (IE Select * Form Order where OrderDate = #" & strCurrentDateTime & "#;"

Make sure strCurrentDateTime is a Date Variable


As far as overcoming the lack of user login to change the timezone info, Capture their zipcode and reference that info to a table comparing zipcode to timezone and change time as needed (May need to purchase the information for this option).

Also fo you really need to reference the Local Timezone or can you just state the date, time, timezone, like a lot of places do.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Now() Date/Time Not Correct -- Better way??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT