Search DominoPower's 11,433 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
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
How not to crash in LotusScript
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login