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
    20,075

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Getting Epoch Time in Javascript

    Getting Epoch Time in Javascript



    To get epoch time in milliseconds using Javascript:

    ko = new Date();
    ji = ko.getTime();

    document.write(ji);

    Which prints something like this:
    1141630966899


    -ko and ji are my made up variable names.
    -Date() and Time() are built in Javascript methods.
    -Epoch time is the number of seconds since January 1, 1970... why that date?... why not!
    -document.write prints to the browser.


    In Javascript, the epoch time you get with getTime() is in milliseconds (i.e. number of seconds multiplied by 1000).


    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    ko = new Date();
    ji = ko.getTime();

    document.write(ji);

    -->
    </script>



    Resources:
    Get Formatted Time in Javascript
    Formatting Time in Javascript
    Setting a Cookie using Javascript

    htmlite.com has a nice Time article



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Reading Cookies using Javascript
    Next Article: Get Formatted Time in Javascript





    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $29.69

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    CSSCSS

    David McFarland

    New $23.09

    Pro CSS and HTML Design ...Pro CSS and HTML Design Patterns

    Michael Bowers

    New $29.69

    Struts 2 in ActionStruts 2 in Action

    Don Brown, Chad Da...

    New $29.69

    DojoDojo

    Matthew A. Russell...

    New $26.39

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39


    Of Interest:
  • OPEN and READ a Data File in Perl
  • Matching with a Regular Expression, REGEX, in Perl
  • Matching at the Beginning and End
  • INCREMENT and DECREMENT a Variable in Perl
  • Javascript Array - Create an Array in Javascript
  • PRINT to Browser with document.write Command in Javascript
  • Javascript Sort - Use Sort on Items in an Array in Javascript
  • Reading Cookies using Javascript
  • Make Strikethrough Text Using HTML
  • HTML Background
  • HTML Subscript Text
  • HTML Color Codes

  • More Articles:
  • If, Elsif, and Else in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • Getting What is Matched in Perl
  • Exit a Script or Subroutine in Perl
  • onClick Javascript
  • Annoy Users with onBlur in Javascript
  • Use innerHTML to Change Text on a Page
  • Environmental Variables Available in Javascript using Navigator Object
  • Get String Length with Javascript
  • HTML Tags
  • HTML Forms
  • HTML Superscript Text
  • Make Text Bold Using HTML

  • 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


    316,815
    Counter by iLoveTheCode.com


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