|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
You could try storing a timezone offset with user accounts, and convert the server's time to the user's time when displaying pages.
|
|
#3
|
|||
|
|||
|
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. ![]() |
|
#4
|
|||
|
|||
|
If it'd help, the "beta" pages are at:
URL and URL No frills, just core database stuff, for now. Thanks!! -David |
|
#5
|
|||
|
|||
|
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- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Now() Date/Time Not Correct -- Better way?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|