Search DominoPower's 11,323 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
PROGRAMMING POWER
Getting the Domino server time with @Now
By Mick Moignard

For a few years now, I've been supporting a Notes application for a customer, and one of the pieces of functionality we wanted in the application for quite some time was to be able to record server, rather than client, clock times when users performed various actions. Following Technote 1099157 in the Lotus Support Knowledgebase, I can see that we weren't alone in this need.

Way back in Notes 6, Lotus added parameters to @now to support this, but of course, it was a while before my client had Notes 6 installed, so we didn't do anything about it. But a couple of years ago, we revisited the issue and added server-clocking to the application.

Let's recap the new optional parameters to @now:

  • flags: [ServerTime] tells @now to go and fetch time from one or more servers, [LocalTimeonError] to fall back to the client clock value if the server is unavailable; combine these as required with a colon.
  • servernames: Here you enter a list of servers; if you leave this out, the server hosting the database is the one whose clock value is returned. If you enter more than one server name as a list, you'll get a list, the same size, of clock values returned, and it's always possible that one or more of those is actually the local time, should the corresponding server be unavailable.

However, we discovered quite rapidly that these changes weren't as useful as we'd hoped. We found that the first time any given server's clock time is accessed, the client fetches the server time and then caches it. Any subsequent calls from the same open database session return the cached value, updated by whatever local time has elapsed since the first call. Which means that the server time returned can be "faked" by altering the local clock, or indeed if the local clock doesn't keep good time and the database is open for any length of time, you get different values to those which you'd expect.

The function was intentionally designed this way for performance -- getting the server time takes a while -- so rather than do it all the time, the designers figured that doing it once and then extrapolating for subsequent calls would be OK. We understood the performance issue, but we wanted to be the people who made the choice of when the server time was fetched, given the particular uses made of the application -- it could be left open continuously for days at a time.


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > Domino (77 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   Sloppy analysis at the core of another Domino vs. SharePoint report
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Home > Tips & Techniques (102 articles)
   More about Domino log files
   Why your log.nsf might not be purging properly
   A faster way to repair corrupted server files
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Five trends for 2010
DominoPower TV Episode 1: Inside a strategy session with Teamstudio
More about Domino log files
Say goodbye to the Uh-Ohs. Long live the Tens.
Why your log.nsf might not be purging properly
Latest Lotus Headlines
Recommended Maintenance - Lotus Notes Traveler
Here are the slides and other materials from our Lotusphere session
Microsoft OCS awareness in Lotus Connections and Websphere Portal?
SnTT: XPages Blank Calendar Control (Part 2), adding data
Have your Lotus Notes calendar display multiple time zones
Sample Database for Microsoft Office and Lotus Symphony Integration
Symphony 3.0 beta signals another attack on Office
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done. Native to Lotus Domino. The User Experience unseen for Lotus Domino. Do more with less. Really.

See the possibilities Docova unleashes for Lotus Domino.
-- Advertisement --

Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.

Register by December 31 to save $350.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login