Here's an example of extracting a date from an email message in Lotus Notes:
use strict; use Win32::OLE; # Open the email database in Lotus Notes my $notes = Win32::OLE->new('Notes.NotesSession') or die "Can't open Lotus Notes"; my $database = $notes->GetDatabase("",""); $database->OpenMail; # Get a list of all of the documents in the Inbox # (Use single-quotes to protect the dollar-sign) my $view = $database->GetView('($Inbox)'); # Get a Notes document my $doc = $view->GetFirstDocument; # The "Created" timestamp is stored as an object # via a property named "Created" my $create_date = $doc->{Created}; # To convert this to a usable date like "09/11/2001", # call the "Date" method on this object my $date = $create_date->Date;
I worked this out via the debugger: I created the object $doc and typed:  m $doc

Aha! The document has a "Created" property. I saved this into $date and typed: x $date

The debugger responded that $date is an OLE object. So I typed: m $date and I saw that it has a "Date" method. Just play around in the debugger and you'll find lots of cool stuff.

buckaduck


In reply to Re: Lotus Notes and datetimes by buckaduck
in thread Lotus Notes and datetimes by Cycle Boy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.