Tips Tricks Tutorials

WEB-NES-BAY

Learn Tips and tricks on Linux, Hacking, linux, PHP, Perl, Web, Hardware

bookmark bookmark
WEBNESBAY On June - 27 - 2009

  • time return number of seconds since 0 in your computer (1 jan 1970) on unix
  • localtime converts unixtime to normal dates
    To convert a specific date to its corresponding unixtime, you use Time::Local, the function looks like this:

      $time = timelocal($sec,$min,$hours,$mday,$mon,$year);

    so to convert 3rd of Sept 2000 to unixtime, (note that jan=0,feb=1,…):

      use Time::Local;
      $time = timelocal(0,0,0,'3','08','2000');
  • Related posts:

    1. Convert str to bytes in python
    2. Special shortcuts in Perl
    3. Send sms using perl
    4. Run IMAP with PERL
    5. Sockets and TCP/IP Networking using PERL
    Categories: Perl

    Leave a Reply