Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:18:14+00:00 2026-05-31T05:18:14+00:00

I have Java code which queries calendar entries from a Lotus Notes Domino server

  • 0

I have Java code which queries calendar entries from a Lotus Notes Domino server (based on a start and end date range). Below is a simplified version of the code.

When querying a Domino server that formats dates the same as the local client, everything is fine, e.g. both the server and client use m/d/y format. However, if the server and the client use different formats (e.g. a server with US formatting m/d/y and a client with German formatting d/m/y), then the wrong number of Lotus Notes entries are being found.

This is because I’m converting the dates into local strings using getLocalTime() and then creating a date range using @TextToTime().

Is there a way to find out what date format the server is using?
Or is there a way to avoid the date-to-string conversion completely? I’d like to pass in the two Lotus DateTime objects and let the server decode them as needed.

import lotus.domino.*;


Session session = NotesFactory.createSession((String)null, (String)null, password);

Database db = session.getDatabase(dominoServer, mailfile, false);

// Get our start and end query dates in Lotus Notes format. We will query
// using the localized format for the dates.
lotus.domino.DateTime minStartDateLN = session.createDateTime(minStartDate);
lotus.domino.DateTime maxEndDateLN = session.createDateTime(maxEndDate);

// Query Lotus Notes to get calendar entries in our date range. 
// Here is an overview of this SELECT:
//   @IsAvailable(CalendarDateTime) is true if the LN document is a calendar entry
//   @Explode splits a string based on the delimiters ",; "
//   The operator *= is a permuted equal operator. It compares all entries on
//   the left side to all entries on the right side. If there is at least one
//   match, then true is returned. Explode is used because the CalendarDateTime
//   field can have many dates separated by ";" (e.g. for recurring meetings).
String calendarQuery = "SELECT (@IsAvailable(CalendarDateTime) & (@Explode(CalendarDateTime) *= @Explode(@TextToTime(\""
+ minStartDateLN.getLocalTime()
+ "-" + maxEndDateLN.getLocalTime() + "\"))))";

DocumentCollection queryResults = db.search(calendarQuery);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:18:15+00:00Added an answer on May 31, 2026 at 5:18 am

    There is a way to find the date format on the Domino server by using the Java lotus.domino.International class (aka NotesInternational class). Here is the final working code.

    import lotus.domino.*;
    
    Session session = NotesFactory.createSession((String)null, (String)null, password);
    
    Database db = session.getDatabase(dominoServer, mailfile, false);
    
    String strDateFormat;
    // Get the date separator used on the Domino server, e.g. / or -
    String dateSep = session.getInternational().getDateSep();
    
    // Determine if the server date format is DMY, YMD, or MDY
    if (session.getInternational().isDateDMY()) {
        strDateFormat = "dd" + dateSep + "MM" + dateSep + "yyyy";                
    }
    else if (session.getInternational().isDateYMD()) {
        strDateFormat = "yyyy" + dateSep + "MM" + dateSep + "dd";
    }
    else {
        strDateFormat = "MM" + dateSep + "dd" + dateSep + "yyyy";
    }
    
    DateFormat dateFormat = new SimpleDateFormat(strDateFormat);
    
    
    String calendarQuery = "SELECT (@IsAvailable(CalendarDateTime) & (@Explode(CalendarDateTime) *= @Explode(@TextToTime(\"" +
        dateFormat.format(startDate) + " - " + dateFormat.format(endDate) + "\"))))";
    
    DocumentCollection queryResults = db.search(calendarQuery); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ported some LGPL code from Java to C#, which I plan to
I have to port some crypto code to visual c++ from java which (visual
I have a multithreaded Java code in which: several threads read stateful objects from
I have a simple java code which gets html text from the input url:
In my source tree have Java code which is automatically generated from XSD files.
I have some Java code which performs bitwise operations on a BitSet. I have
I already have Java code to display and process data from a database. I
I have a java script code which will set some values in a form
I have some legacy Java code inside which I'd like to call a groovy
We have an SOA based project which has been built from the ground up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.