akagrawal3 has asked for the wisdom of the Perl Monks concerning the following question:

$some_date_time = gmdate $some_date_time Kindly help me in knowing what does gmdate do.

Replies are listed 'Best First'.
Re: gmdate perl
by Anonymous Monk on Mar 04, 2012 at 09:46 UTC
      Well I think that it sets the time to GMT.

        Well I think that it sets the time to GMT.

        Lets see, searching Class::Date for "gmdate"

        use Class::Date qw(:errors date localdate gmdate now -DateParse -EnvC);

        $date = gmdate "2001-11-12 17:13";

        You can create a date object by the "date", "localdate" or "gmdate" function, or by calling the Class::Date constructor.

        "gmdate $x" is equivalent to "date $x, $Class::Date::GMT_TIMEZONE".

        It could be

      I have used the following in the code. I guess this might help.  use Class::Date qw/gmdate now/;
Re: gmdate perl
by Marshall (Canon) on Mar 04, 2012 at 10:19 UTC
    First, for a situation like this, show runnable Perl code!

    PHP gmdate function.

    PHP code is not Perl code!

    I am unaware of a function called gmdate() within common Perl modules.

    Update: Class::Date has this function and it appears to be just fine. Good enough.

      First, for a situation like this, show runnable Perl code!

      FWIW, the op did, half an hour ago :D