[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] Palm::DateTime.pm




 I'm not sure if i call correctly the mktime(9)function
 within DateTime.pm.

 Attached with this mail you fill find a test conduit. I need
 some test result with this conduit and the latest DateTime.pm
 (you can get it from http://cvs.coldsync.org).

You should especially check if the result of the Palm: line 
 is coherent with the Dump: line as i had a problem when
 converting the palm generated time
 to a secs value using mktime().

With the old version a problem arised when DST was
 effective in the server's timezone.
 

-- 

  - alex.

#!/usr/bin/perl -w


use strict;

use ColdSync;
use ColdSync::SPC;
use Palm::DateTime;

use Data::Dumper;


MyStartConduit('sync');

	
	my $ptime	= dlp_GetSysDateTime();
	my $palm_secs	= palmtime_to_secs( $ptime );
	my $palm_date	= localtime( $palm_secs );
	my $date	= localtime();


	print STDERR "Host: $date\n";
	print STDERR "Palm: $palm_date [$palm_secs]\n";
	print STDERR "Dump: " . Data::Dumper->Dump( [ $ptime ] ); 


MyEndConduit();

sub MyStartConduit
{
	my( $flavor ) = @_;

        &ColdSync::ParseArgs($flavor);

        if ($ColdSync::FLAVOR ne $flavor)
        {
                die "403 Unsupported flavor\n";
        }

	ColdSync::ReadHeaders;
        if (exists $ColdSync::SPC::{"VERSION"} and
            defined $HEADERS{"SPCPipe"})
        {
                ColdSync::SPC::spc_init;
        }
}

sub MyEndConduit
{
        print STDOUT "202 Success!\n";
        exit 0;
}