[systemd-devel] How to set time from Perl

Mantas Mikulėnas grawity at gmail.com
Mon Sep 7 07:37:36 PDT 2015


On Mon, Sep 7, 2015 at 5:23 PM, Manuel Reimer <Manuel.Spam at nurfuerspam.de>
wrote:

> Hello,
>
> if I run the following code on an intel based platform, then I don't have
> any problems:
>
>   use Net::DBus;
>   my $bus = Net::DBus->system();
>   my $logind = $bus->get_service('org.freedesktop.timedate1');
>   my $manager = $logind->get_object('/org/freedesktop/timedate1',
>                                     'org.freedesktop.timedate1');
>   $manager->SetTime($time * 1000000, 0, 0);


On 32-bit systems you may need to "use bigint;" for integers larger than
0x7fffffff. (Possibly also explicitly pass the value as a dbus_int64()...)

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150907/e84d4a84/attachment.html>


More information about the systemd-devel mailing list