File: time.pl

package info (click to toggle)
libdate-pcalc-perl 6.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,904 kB
  • sloc: perl: 16,706; ansic: 3,086; sh: 14; makefile: 5
file content (36 lines) | stat: -rwxr-xr-x 1,309 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl -w

###############################################################################
##                                                                           ##
##    Copyright (c) 2001 - 2009 by Steffen Beyer.                            ##
##    All rights reserved.                                                   ##
##                                                                           ##
##    This program is free software; you can redistribute it                 ##
##    and/or modify it under the same terms as Perl itself.                  ##
##                                                                           ##
###############################################################################

BEGIN { eval { require bytes; }; }
use Date::Pcalc::Object qw(:all);

Date::Pcalc->date_format(2);

$time = time;

$date = Date::Pcalc->new(Today_and_Now(0));
print "Today_and_Now(0)          = $date\n";

$date = Date::Pcalc->new(Today_and_Now(1));
print "Today_and_Now(1)          = $date\n";

$date = Date::Pcalc->new( 0, Add_Delta_DHMS( 1970,1,1, 0,0,0, 0,0,0,$time ) );
print "Add_Delta_DHMS($time) = $date\n";

$date = Date::Pcalc->gmtime(time);
print "gmtime($time)         = $date\n";

$date->localtime(time);
print "localtime($time)      = $date\n";

__END__