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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:31:16+00:00 2026-06-03T08:31:16+00:00

I have time saved in database like 7:30pm as a varchar field. I want

  • 0

I have time saved in database like 7:30pm as a varchar field. I want to check if this time is greater than time right now or not.

I converted the DB time string into ’19:30′ and now I want to do something like this:

$my_time = '19:30';

if($my_time  > date('H:i'))
{
    do something ...
}

The problem is the above will return always true if $my_time is non-empty string.

doing strtotime($my_time) is not helping either.

strtotime('H:i',$my_time) makes it 00:00 .

doing (int)date('H:i') will give 1700 when the actual time is 17:09, so removing colon and then comparing will not work too ….

Changing database time data is out of question in this context.

plz help. Correct me if I stated some facts wrong.

  • 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-03T08:31:17+00:00Added an answer on June 3, 2026 at 8:31 am

    You can use this:

    $myTime = '19:30';
    if (date('H:i') == date('H:i', strtotime($myTime))) {
        // do something
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a date time that I generate like this: DateTime myDateTime = DateTime.Now;
I need to learn RegEx but don't have time to figure this out right
Okay, Now admittedly this sounds like a silly question; But, I actually have a
I have 50000 XML records like this in the database: <?xml version=1.0 encoding=UTF-8?> <root>
This just saves time. Since I already have a web applciation. I can just
How do I check for time for between. suppose I have Time in string
have one time consuming step that flattens a bunch of files. basically i'd like
This has been driving me nuts for a week now. I have a class
I have a table in my database which is house, that has many field
i have a list of events Appointments in my database, like at 3:00pm etc,

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.