Search DominoPower's 10,675 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.

More fun with dates in LotusScript
By Mick Moignard

I'm sure that anyone who's had more than a passing involvement with Notes applications and with LotusScript has had involvement with date/time fields. Indeed I've written about some aspects of date fields before, see DominoPower Magazine January 2003, "Tips and tricks in LotusScript", http://www.dominopower.com/issues/issue200302/script001.html, where I mentioned how date fields are stored, and how the internal value can be manipulated via a Variant date type.

Dates seem to be an ongoing problem, and indeed in the project I'm still working on we've dealt with a number of date-field issues. The application deals with synchronizing data entered in a Notes-client front-end system with a back-end Oracle database, using LEI (Lotus Enterprise Integrator) and Scripted Activities, which connect to Oracle using the back-end connectors and the Lotus Connector LSX (LotusScript Extension), lsxlc. We've had some interesting incidents with null date values, and we've also had to find ways around other content and representational issues. Let's look at a couple of them.

Getting rid of the time component
The first one has been about trying to lose the time-portion of a Notes date-time value. In Oracle, as in Notes, date type values contain a date and a time. In most cases the front-end application is only interested in dates. While many of the front-end fields truncate the time part, quite a few don't. We experimented quite a bit before we found, what was in hindsight, the rather obvious answer.

First we checked using NotesDateTime.DateOnly, but of course this returns a string, not a date. So that's no good. One reason is because when you try to put a string date value back into a Notes Date/Time field, you're at the mercy of how the date string is interpreted, which I covered in the January 2003 article. It's not good practice to convert strongly typed values like dates to weaker types, like a string, and back again.

Then we tried setting the time portion of the time to zero, and predictably that displayed dates with zero times. Also no good. But we knew that Notes could store a date with no time, because we could see it in the properties box and with Notespeek. We found that a field typed as "date only" appeared as follows in Notespeek.

name "dateonly"
type Time
class Time
flags Summary
length 8
value <29/11/2004> ; 00256F5B:FFFFFFFF

While a field defined as date and time had a value line that looked like this:

value <29/11/2004 11:03:00> ; 80256F5B:003CB310

And the difference is obvious. But how to set the time portion to x"FF"?


1  ·  2  ·  3  ·  Next »
Other articles you might like
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
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
What to look for in a Domino-based document management solution
Understanding Domino.doc end-of-life options
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
Top 10 ways to launch and build a Lotus consulting practice (with a little help from the Beatles)
Troubleshooting an OpenSuse Notes install
Incident report: denial of service attack against ConnectedPhotographer.com
Latest Lotus Headlines
SnTT - Enabling ALL the bells and whistles!
Tivoli Data protection causes Domino to crash
Fun when running DB2 CLP scripts
Introducing Flippr, the easy way to admin Quickr
DXL and fake security
Using search forms in IBM Workplace Collaborative Learning 2.7
Schmidt, Freed, and Gering on the OVF Toolkit
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Eight steps to successful and reliable home backups
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Can Outlook run when it's not running (and other mysteries)?
-- 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 --

Want The Top Lotus Experts By Your Side Without Paying Hefty Consulting Fees? Look No Further.
Like having a team of consultants by your side -- ones who have all the answers and never make mistakes -- THE VIEW gives you immediate access to field-tested instruction, guidance, and best practices from the brightest Lotus professionals around.

Join your peers who realize their Lotus technology is too important to let people from blogs and forums tell them how they should implement it, run it, and use it. THE VIEW is where only the world's top Lotus experts provide validated support to you on a weekly basis to ensure you work more efficiently, get more out of your Lotus technology, and stay clear of costly mistakes.

Check out the new instruction, tips, and best practices added to THE VIEW this week.

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