Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum



PreviousPrevious NextNext

RE: Date & time problem in agent
Karl-Henry Martinsson 25.Feb.13 11:45 AM a Web browser
Applications Development All Releases All Platforms

"It is a very old code near 2003-2004 and written by old developer, It was working fine some time ago.. therefore i can not change the code."

If it is working fine, you don't need to change it.
If it is not working fine, you must change it anyway.

Do you have some kind of rule at yrou company that you can only change one line of code, or just a certain number of characters?
Why not fix the code that the old (and obviously not too knowledgeble) developer wrote? You can remove some useless code anyway, there is for example no need to declare 'current' and to assign it a value of Now()...

Won't you agree that this code is much nicer, and easier to debug?

Dim session As New NotesSession
Dim view As NotesView
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim accessed As NotesDateTime

Set db = session.CurrentDatabase
Set view = db.GetView("AllDocument")
Set doc = view.GetFirstDocument

Set accessed = New NotesDateTime(doc.LastAccessed)
Call accessed.AdjustHour(24)

If accessed.LSLocalTime < Now() Then
MsgBox("Accessed more than 24 hours ago.")
MsgBox("Accessed less than 24 hours ago.")
End If

Date & time problem in agent (Baba Tony 22.Feb.13)
. . Agent works for me (Doug Finner 22.Feb.13)
. . RE: Date & time problem in agent (Karl-Henry Mart... 24.Feb.13)
. . . . RE: Date & time problem in agent (Baba Tony 25.Feb.13)
. . . . . . RE: Date & time problem in agent (Carl Tyler 25.Feb.13)
. . . . . . RE: Date & time problem in agent (Karl-Henry Mart... 25.Feb.13)

Document Options

  Document options
Print this pagePrint this page

Search this forum

Forum views and search

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Advanced search

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite