Search DominoPower's 11,443 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
Syncing Notes with Android phones
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
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- Advertisement --

Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.

The many included activities and demos will make you a pro! Expert instructor help is a click away.

Click here to try a FREE demo course!!

-- Advertisement --

Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino

  • Don't spend unproductive time maintaining different versions of the same spreadsheet
  • Preserve data integrity and security in multi-user environments
  • Create reports in minutes INSIDE Notes
  • Get freedom from iterative report requests, deliver self-serve capabilities

Experience Reporting, Dashboards, and Analysis INSIDE Notes.

Try IntelliPRINT NOW!

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