VBoxManage.exe modifyvm "NameDerVM" --biossystemtimeoffset [ZeitInMillisekunden]
2012-02-10T14:08:28 biancaIch verwende gern Date::Calc.
Da gibt es Mktime() womit man aus dem Datum den Zeitwert errechnet.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use strict; use warnings; use Date::Calc 'Date_to_Time'; my $command='VBoxManage.exe modifyvm "NameDerVM" --biossystemtimeoffset %u'; my $date='14.10.2011'; my $time=time(); $time-=Date_to_Time(reverse(split(/\./,$date)),0,0,0); $time*=1000; $command=sprintf($command,$time); exec($command) or die(qq[ERROR exec "$command" ($!)\n]); die("Something went wrong!\n");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use warnings;
use Date::Calc 'Date_to_Time';
my $command='"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm "Neue VM" --biossystemtimeoffset %u';
my $date='14.10.2011';
my $time=time();
$time-=Date_to_Time(reverse(split(/\./,$date)),0,0,0);
$time*=1000;
$command=sprintf($command,$time);
exec($command) or die(qq[ERROR exec "$command" ($!)\n]);
die("Something went wrong!\n");
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use strict;
use warnings;
use Date::Calc 'Date_to_Time';
my $command='"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm "Adobe Acrobat" --biossystemtimeoffset -%s';
my $date='14.10.2011';
my $time=time();
$time-=Date_to_Time(reverse(split(/\./,$date)),0,0,0);
$time*=1000;
$command=sprintf($command,$time);
[b]
$command[/b] exec($command) or die(qq[ERROR exec "$command" ($!)\n]);
die("Something went wrong!\n");
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; use Date::Calc 'Date_to_Time'; my $command='"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyvm "Adobe Acrobat" --biossystemtimeoffset -%s'; my $date='14.10.2011'; my $time=time(); $time-=Date_to_Time(reverse(split(/\./,$date)),0,0,0); $time*=1000; $command=sprintf($command,$time); print "!! $command !!\n"; exec($command); die(qq[ERROR exec "$command" ($!)\n]);