iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • I love the code... dot com
    123,750

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Getting Server Time in Perl

    Getting Server Time in Perl



    $etime=$^T;


    The variable you named $etime now contains Epoch time, which looks something like this 1140628728. Epoch time is the number of seconds since January 1, 1970. Why then? Why not.


    To get the local time of your server machine:

    $newetime=localtime($^T);

    The variable you named $newetime now contains the time on the server in a nice neat format. (Perl's built-in localtime function took care of formatting for us.)

    Wed Feb 22 12:21:51 2006


    Copy and Paste Perl Code:

    #!/usr/bin/perl

    print "Content-type:text.html\n\n";

    $etime=$^T;

    $newetime=localtime($^T);

    print "$etime - $newetime";

    exit;



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: If, Elsif, and Else in Perl
    Next Article: Substitute in Perl





    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    CSSCSS

    David McFarland

    New $23.09

    DojoDojo

    Matthew A. Russell...

    New $26.39

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    CSSCSS

    Eric Meyer

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39


    Of Interest:
  • OPEN and WRITE a Data File in Perl
  • Encryption with the Crypt Function in Perl
  • Opening and Reading a Directory in Perl
  • Putting Two Strings Together, Concatenate
  • Write a For Loop in Javascript
  • PRINT to Browser with document.write Command in Javascript
  • Javascript Shift - Use Shift to Remove Items from the Beginning of an Array in Javascript
  • Javascript Slice - Use Slice to Get Items from an Array in Javascript
  • HTML Font Code
  • HTML Space
  • HTML Forms
  • Make Italic Text Using HTML

  • More Articles:
  • Create a Subroutine in Perl
  • Matching at the Beginning and End 2
  • OPEN and WRITE a Data File in Perl
  • Finding the Length (Index Numbers) of an Array in Perl
  • onClick Javascript
  • Close Window with window.close in Javascript
  • Use innerHTML to Change Text on a Page
  • Setting a Cookie using Javascript
  • Use onLoad in Body Tag with Javascript
  • Make Text Bold Using HTML
  • HTML Color Codes
  • HTML Space
  • HTML Title Tag

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,511
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:13 EDT