Perl set a specific datetime

Code examples

5
0

perl set a specific datetime

# For Perl only

# syntax
use DateTime;
my $YourDate = DateTime->new(
    year       => <your-year>,
    month      => <your-month>,
    day        => <your-day>,
    hour       => <your-hour>,
    minute     => <your-minute>,
    second     => <your-second>,
    nanosecond => <your-nanosecond>,
);

# example: 
use DateTime; 
my $YourDate = DateTime->new(
    year       => 1994,
    month      => 05,
    day        => 25,
    hour       => 13,
    minute     => 31,
    second     => 18,
    nanosecond => 0,
);

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

Popular in the category

Popular pages with examples in the category