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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:49:07+00:00 2026-06-07T15:49:07+00:00

I am setting a Database value within from a PHP file. In php file

  • 0

I am setting a Database value within from a PHP file. In php file i have a string variable which stores unix timestamp value.

MySql table i am having is having a schema where i have to store these timestamp values in login field which is of timestamp datatype.

i tried sending

date('Y-m-d G:i:s', strtotime($userLogin));

to my database but all it stores is 0000-00-00 00:00:00

  • 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-07T15:49:08+00:00Added an answer on June 7, 2026 at 3:49 pm

    strtotime () is intended for converting strings in various date formats into UNIX timestamps. If the string is a timestamp already then it won’t look like a meaningful formatted date/time to strtotime () and it will fail.

    If the string is already a timestamp, then you don’t need to do anything more to it than cast it to integer (strictly speaking even that step shouldn’t be necessary, but casting will strip out any non-numerical characters, so it doesn’t usually hurt to cast)

    Additionally, MySQL is capable of parsing UNIX timestamps (with FROM_UNIXTIME(), I think, I’d have to look it up to be sure)

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

Sidebar

Related Questions

I have a setting stored in database which has a value .jpg|.gif|.png . I
I'm setting up a custom blog that grabs the posts from a mysql database.
If I try to search for a value in mysql database and the string
My dates in mysql database are setting to 1999-11-30 no matter what I enter
I am setting up a MySQL database with multiple tables. Several of the tables
I am re-using ListPreference for a setting which I store only in the database.
My program is fetching messages from a database, which contains English, German and several
I have Oracle 11 database to which I connect using both JDBC and ODBC.
I'm trying to insert values into a SQL database from within Java. This works
I have a table with with essentially three columns: user_id, setting, and value. I'm

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.