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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:41:11+00:00 2026-05-25T10:41:11+00:00

I got a bit of a problem here. My database stores unix timestamps as

  • 0

I got a bit of a problem here. My database stores unix timestamps as a string 2011-09-01 20:22:36 and I need it as a Unix Timestamp ########### so I can compare it using a > then symbol. But I also need to have it automatically set the timestamp on update (ON UPDATE CURRENT TIMESTAMP) as well as have a default of the timestamp which is not really that important cause I can do that in PHP if I need to.

How can I do this? timestamp is now a date/time combo string and not a integre so I cannot compare it?

My comparison string is

$sql = sprintf("SELECT nid, field_date_value, field_movie_location_value FROM content_type_mobile_event WHERE updated<'%s'", $vid);

Incase anyone is wondering.

  • 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-25T10:41:12+00:00Added an answer on May 25, 2026 at 10:41 am

    Use the UNIX_TIMESTAMP() function to convert it inside your query. If you must compare it to a Unix timestamp from PHP, it is easiest to allow MySQL to handle the column’s conversion on its end.

    $sql = sprintf("SELECT nid, othercols FROM content_type_mobile_event WHERE UNIX_TIMESTAMP(updated) < '%s'", $vid);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a bit of an obscure problem and I'm hoping someone here can
I've got a bit of a problem. Essentially, I need to store a large
Bit of a strange problem here... I've got an update query that isn't working,
Ok I've got a bit of an interesting problem on my hands. Here's a
I've got a bit of a problem, I'm using a backgroundworker to do a
I've got a bit of a problem with making my data loading and filtering
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I've got a bit of an odd issue here. Basically it only occurs in
I got a little problem. I'm using Full outer Join in Sql server -
I've got a problem where I generated a Quicktime plgin using the AC_Quicktime plugin,

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.