Try to find $TimeStampYesterday

English! place to talk about development, programming and coding
Post Reply
jfberni
Znuny newbie
Posts: 17
Joined: 03 Mar 2011, 16:51
Znuny Version: 3.0

Try to find $TimeStampYesterday

Post by jfberni »

hi Everyone,


Easy question, I would like to have Yesterday in timestamp.

This is example of Tomorrow.

my ( $Sec, $Min, $Hour, $Day, $Month, $Year ) = $Self->{TimeObject}->SystemTime2Date(
SystemTime => $Self->{TimeObject}->SystemTime() + 60 * 60* 24,
);
my $TimeStampTomorrow= "$Year-$Month-$Day 23:59:59";

Try with -3600 seconds, it doesn't work.
my ( $Sec, $Min, $Hour, $Day, $Month, $Year ) = $Self->{TimeObject}->SystemTime2Date(
SystemTime => $Self->{TimeObject}->SystemTime() - 3600,
);
my $TimeStampYesterday= "$Year-$Month-$Day 23:59:59";

Any idea ?

thanks

J-F
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Try to find $TimeStampYesterday

Post by reneeb »

You should subtract 86400 (its 60 seconds * 60 minutes * 24 hours), you just subtract one hour (60 seconds * 60 minutes => 3600).
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
truman
Znuny newbie
Posts: 1
Joined: 24 Dec 2012, 07:10
Znuny Version: 20095

Re: Try to find $TimeStampYesterday

Post by truman »

The version 0.0.4 should hit OPAR in a few minutes. With that version you can define if it is placed at the top or at the botton of the sidebar...
Post Reply