![]() |
![]() |
|
|
|
|
#1 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,569
|
I did do a bit more research into this and still couldn't find a really clean way of getting the NY time from anywhere in the world. Here are a few options that I can think of:
1. Always use EST. This is the easiest way and your code will be robust. If you need to report on when records were added then you can use a function to convert from EST to the NY time (probably using a table that shows daylight savings start and end points for each year). Maybe if you can explain what you're using the time stamp field for we could determine if this is a workable solution. 2. Look in the registry and determine what the time is in New York. If you look in the registry under HKLM/SOFTWARE/Microsoft/Windows NT/Current Version/Time Zones you can see that there is a folder for each time zone available within the regional settings in Windows. You could probably read the time for any zone by reading the appropriate time zone (looks like it's under the Eastern Standard Time folder in Windows XP at least). This option might work quite nicely. I think option 1 is more robust, option 2 would involve some reasonably advanced code. What are your thoughts on 1? DK |
|
|
|
|
|
#2 | |
|
Join Date: Oct 2006
Location: Ottawa, Canada
Posts: 379
|
Quote:
I also did a bit of looking but could not find anything better than your option1. The only other thing I would add is that - if it were possible to get to a "time site" that provided the current time in New York and return that value all while working within your application - then that might be a solution. I have not seen anything robust nor easy to understand re calling a webservice from MSAccess. Re your comment in #1 "Maybe if you can explain what you're using the time stamp field for we could determine if this is a workable solution." may shed more light on possible solutions. The functions we have can tell what time zone pjhofer83 is in -- that is EST or EDT provided he gets regular updates via Internet. (This is done automatically if your computer is attached to internet- as best I can discover.) jack |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|