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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:14:34+00:00 2026-05-28T18:14:34+00:00

This is just a sanity check, but I’ve done several test cases before you

  • 0

This is just a sanity check, but I’ve done several test cases before you all jump on the “down” button =]

I just want to check that comparing dates from a MySQL database in the format YYYY-MM-DD HH:MM:SS in JavaScript will work correctly. Unfortunately, I can’t edit the query to return a Unix timestamp.

Example:

console.log('2010-05-22 00:54:12' > '2010-05-21 11:44:32');

All my test cases seem to suggest it works fine, but I just need to make sure.

Maybe my Google-fu is weak, but I can’t find anything about it online. Does anyone know for sure?

  • 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-28T18:14:36+00:00Added an answer on May 28, 2026 at 6:14 pm

    Yes, I’m sure one reason they chose such a format was so you could do a standard string comparison on them.

    Because the order of values is most-significant to least-significant, this will work perfectly fine as long as:

    • The hour is in 24-hour time, and
    • Any single digit value is preceded by a 0 (month, day, hour, etc.)

    However do note that unless you standardize on a particular time zone (GMT for example), this will only accurately compare dates in a single time zone.

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

Sidebar

Related Questions

I don't think that this could be done in C#, but posting this just
I just need a sanity check here... DEMO Basically, I can't figure out how
This is more of a sanity check than anything else. I've found that when
just a sanity check please: in VB.NET: dim myarray(5) as integer gives six elements
This question is largely a sanity check. I've organized a DB by a collection
Ok just to sanity check overload doesnt seem to be working for me. I
Hey all, I'm still relatively new to Java, and looking for a sanity check.
Just a quick sanity check here! If I have a static method in an
This just won't work. The problem is that I do not know enough to
This just started happening three weeks or so ago. The content of my website

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.