Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:37:11+00:00 2026-05-16T07:37:11+00:00

In most of the Programming or scripting language such as PHP or JavaScript, i

  • 0

In most of the Programming or scripting language such as PHP or JavaScript, i have come across the time function which tends to calculate the time from year 1970. for example in javascript if i use the function getTime() or in PHP the time() it returns an integer value.

In PHP.

the code with <?php echo time(); ?> returns an integer value of 1281694425,
what does the value returned by the PHP explains? how and when it is useful?

the same in javascript the getTime() returns the float value since 1970 as it says. by using the below script in JS

<script type="text/javascript">
var d=new Date();
document.write(d.getTime() + " milliseconds since 1970/01/01");
</script>

i want to know when is this type of functions useful to use? and how do we use it?

P.S: is it useful for calculating the time interval? or it is used for storing the current time stamp?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:37:12+00:00Added an answer on May 16, 2026 at 7:37 am

    It give you the seconds which passed by since the 1st January 1970. This is useful fore several reasons:

    1. Sorting of dates is as simple as sorting integers.
    2. Its easy to get the length of an interval, simple do t1-t2 and you get the difference in seconds again.
    3. No need to handle different date-formats (like MM/DD/YY or DD/YY/MM): Every programming language and every database supports integers.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I understand correctly, most programming language which provide a library function to retrieve
Most programming languages are utilizing lambdas/closures. Which language agnostic source is recommended as the
In most programming languages you often have a namespace > files > classes >
What is the most concise programming language? in case a criteria is needed for
Most of my company's web programming background is PHP, so ASP.NET MVC was a
This not a programming question but Most of the programmers using Eclipse should have
Traditionally most programming languages have priority of AND higher than priority of OR so
In most programming languages, arguments passed to a function are evaluated before the function
In most programming languages I have used you can do something like (where s
I understand the concepts of \t and \n in most programming languages that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.