Skip to content

Instantly share code, notes, and snippets.

@need4spd
Created November 29, 2012 00:54
Show Gist options
  • Save need4spd/4165959 to your computer and use it in GitHub Desktop.
Save need4spd/4165959 to your computer and use it in GitHub Desktop.
[Perl] Date연산
#!/usr/bin/perl
use DateTime;
use strict;
use warnings;
my $start_date = DateTime->new(
year=>1901,
month=>1,
day=>1,
);
my $end_date = DateTime->new(
year=>2000,
month=>12,
day=>31,
);
DateTime->compare($start_date, $end_date); #비교구문
$start_date->day == 1; #일
$start_date->day_of_week == 7; #요일, 7이 일요일
$start_date->add(days=>1); #연산
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment