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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:36:57+00:00 2026-06-05T17:36:57+00:00

I had this weird problem a little while ago and haven’t been able to

  • 0

I had this weird problem a little while ago and haven’t been able to find a solution yet. In my application, I keep some information about the activity of the user on my server. I also keep the date of the activity using getdate() function of PHP. When queried, I send this information back to the phone and try to represent the date in a more human-readable format.

For example,

//This is the part that runs on the server
$timeOfAct = getdate();
//$timeOfAct = 1339637005. I guess this is the date in milliseconds
//INSERT $timeOfAct to database

I send this information back to the application using JSON.

//st="1339637005"
SimpleDateFormat ft = new SimpleDateFormat("MM/dd/yyyy");
Date resultdate = new Date(Long.parseLong(st));
st=ft.format(resultdate);

st always becomes 01/16/1970.

As far as I understand, date 0 for JAVA is not equal to 0 for PHP.

So, do you have any suggestions for me to achieve a successful conversion?

UPDATE: I forgot to mention that I was using the 0th element of the array returned by getdate() which is equal to what is returned by time() function

//E.g. INSERT $timeOfAct[0]

  • 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-05T17:36:59+00:00Added an answer on June 5, 2026 at 5:36 pm

    getdate() returns an associative array of information related to the timestamp, not what you guessed.

    If you want timestamp, just use time().

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

Sidebar

Related Questions

i came across this weird problem and don't seem to find a solution for
Ok this is a weird problem because I had it working before. So I
I had this problem some time ago and I gave up but lately it
I have this weird problem which I don't remember to ever had in XCode
I've had this problem for a while, and no one I've talked to on
I had this weird experience with problem number 10 on Project Euler (great site
Had this working; at one stage. The problem is the following text is now
I had this problem before and can't for life of me remember how to
I have this weird problem where my Google Maps API script doesn't work, no
I am having a very weird problem that I've never had before when using

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.