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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:53:59+00:00 2026-05-21T22:53:59+00:00

All, How can I convert to a unix timestamp to date and time in

  • 0

All,

How can I convert to a unix timestamp to date and time in local timezone. For timestamp = 1303374724716, the date ('r', $timestamp) function of PHP gives me Sun, 16 May 2032 22:11:37 +0000 whereas the epoch converter CORRECTLY converts to
GMT: Thu, 21 Apr 2011 08:32:04 GMT
Your timezone: Thu Apr 21 2011 04:32:04 GMT-0400 (Eastern Daylight Time)

I have seen the php.ini file and the default timezone is UTC. I don’t understand why the value doesn’t even match the GMT/UTC time. Can anyone please help me convert to my local timezone i.e. New_York.

  • 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-21T22:54:00+00:00Added an answer on May 21, 2026 at 10:54 pm

    That is because the timestamp you are given is in milliseconds.

    Do:

    $timestamp = floor(1303374724716/1000);
    

    And everything will work as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way I can convert ALL characters, including regular ones, using PHP
PHP has a nice realpath() function, which can convert something like /dir1/dir2/../dir3/filename to /dir1/dir3/filename
Can anyone please tell me how I convert DD-MM-YYY (text) to TIME (unix) thought
I'd like to a convert unix timestamp I have in a string (ex. 1277722499.82)
I want to convert all files to dos to unix format from a folder
I'm using SSRS 2005 and I need to convert time from a serial unix
How I can convert all value of element and attributes of xml to Map
Hey all! Ive got timezone troubles. I have a time stamp of 2010-07-26 23:35:03
I have a list of text urls in, how i can convert all of
Why all use binary files, if all can use XML ?

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.