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 8593521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:00:38+00:00 2026-06-12T00:00:38+00:00

Possible Duplicate: How to get current time in ms in PHP? I am trying

  • 0

Possible Duplicate:
How to get current time in ms in PHP?

I am trying to figure out the best way to get the current time in milliseconds. As a company I am doing work for stores milliseconds in a database as they lay claim that its more accurate as far as UTC conversion goes. They obtain most of these times via javascripts date function. So what I am trying to figure is what is the best way to do this php side. I see mixed results.

time()*1000 seems to be popular, but for me that doesnt make sense, as your ending up with a normal timestamp with 3 additional zeros at the end, which yea thats closer to accurate, but still not exact. I have also seen

microtime(time(), TRUE) or something to the extent there of, but that returns a result with a decimal from what I gather. Which again isn’t up to par with what I am looking for. That said. Whats the best approach to getting a javascript readable version of a javascript style timestamp created by PHP on the fly?

  • 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-06-12T00:00:39+00:00Added an answer on June 12, 2026 at 12:00 am

    microtime(time(), TRUE) is not valid and time()*1000 would not give you the best result

    You can try

    Javascript

     document.write(new Date().getTime()); // 1348773527231
    

    PHP

    print(round(microtime(true) * 1000)); // 1348773528231
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Date to timestamp (PHP)? How do I get the current time in
Possible Duplicate: Get current date and time in PHP I was wondering how can
Possible Duplicate: get name of current PHP script in include file Can an included
Possible Duplicate: Get URL of ASP.Net Page in code-behind I'm trying to hold current
Possible Duplicate: How to get the current date and time of your timezone in
Possible Duplicate: How do I get current page full URL in PHP How can
Possible Duplicate: How do I use PHP to get the current year? 2009 this
Possible Duplicate: Retrieving current local time on iPhone? How to get current time ?(hour:minute:second)
Possible Duplicate: Delphi Timer: Time before next event How to get current timeleft when
Possible Duplicate: Guessing User's TimeZone in PHP How can i get my system current

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.