The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Jabber::Query::Time - Jabber IQ Time Module

SYNOPSIS

  Net::Jabber::Query::Time is a companion to the Net::Jabber::Query module.
  It provides the user a simple interface to set and retrieve all parts
  of a Jabber Time query.

DESCRIPTION

  To initialize the Query with a Jabber <iq/> and then access the time
  query you must pass it the XML::Parser Tree array from the 
  Net::Jabber::Client module.  In the callback function for the iq:

    use Net::Jabber;

    sub iqCB {
      my $iq = new Net::Jabber::IQ(@_);
      my $time = $iq->GetQuery();
      .
      .
      .
    }

  You now have access to all of the retrieval functions available.

  To create a new Query time to send to the server:

    use Net::Jabber;

    $client = new Net::Jabber::Client();
    ...

    $iq = new Net::Jabber::IQ();
    $time = $iq->NewQuery("jabber:iq:time");
    ...

    $client->Send($iq);

  Using $time you can call the creation functions below to populate the 
  tag before sending it.

  For more information about the array format being passed to the CallBack
  please read the Net::Jabber::Client documentation.

Retrieval functions

    $utc      = $time->GetUTC();
    $timezone = $time->GetTZ();
    $display  = $time->GetDisplay();

Creation functions

    $time->SetTime(utc=>'20000314T09:50:00',
                   tz=>'EST',
                   display=>'2000/03/14 09:50 AM');

    $time->SetUTC('20000419T13:05:34');
    $time->SetTZ('CST');
    $time->SetDisplay('2000/04/19 01:50 PM');

METHODS

Retrieval functions

  GetUTC() - returns a string with the universal time constant time in 
             the <query/>.

  GetTZ() - returns a string with the timezone in the <query/>.

  GetDisplay() - returns a string with the displayin the <query/>.

Creation functions

  SetTime(utc=>string,     - set multiple fields in the <iq/> at one
          tz=>string,        time.  This is a cumulative and over
          display=>string)   writing action.  If you set the "utc" 
                             twice, the second setting is what is
                             used.  If you set the tz, and then
                             set the display then both will be in the
                             <query/> tag.  For valid settings read 
                             the specific Set functions below.

  SetUTC(string) - sets the universal time constant time for the 
                   <query/>.  The format for the UTC is:
 
                     yyyymmddThh:nn:ss

                     yyyy - year
                     mm   - month
                     dd   - day
                     hh   - hour
                     nn   - minute
                     ss   - second

  SetTZ(string) - sets the timezone of the local client in the <query/>.


  SetDisplay(string) - sets the string to display as the local time in
                       UTC format in the remote client.

AUTHOR

By Ryan Eatmon in May of 2000 for http://jabber.org..

COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.