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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:28:43+00:00 2026-05-21T10:28:43+00:00

I have a text file with records in it. I need to decide if

  • 0

I have a text file with records in it. I need to decide if the time (which is part of the record structure) is between 2 times (stored in strings) that represents the lower and upper range.
In the file the time is represented in 145540123456, which means 14 is the hour, 55 – minutes, 40 – seconds, 123456 – micrseconds accurate.

The upper and lower time that I get to decide if it is in the range, I get it as a string in the same format for instance “093000000000”. How do I make the calculation, do I need to do it with time_t and time library?

Note: I can’t use Boost.

  • 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-21T10:28:43+00:00Added an answer on May 21, 2026 at 10:28 am

    The format you specify has the simple advantage that sorting these time-strings alpha-numerically will keep them in the correct order.

    Therefore, using strcmp (simple C function if using null-terminated char * buffers), or the comparison operators for std::string can allow you to determine easily if a certain time string belongs to an interval.

    These methods can lead to very few calculations, if, for example, the first character of the strings you compare differs, since the standard functions should be smart enough to stop comparing the strings as soon as they have determined the result.

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

Sidebar

Related Questions

I have a text file containing a number of records. Each record is stored
I have following records in text file, need to extract that record form text
I have a text file that has many records. Each record is a xml
I have a text file containing some records. Each record is splitted in 4
I have a table and a text file. Once the records in the table
I have text file with some text information and i need to split this
I have a text file contains delimited records. 1243;jhhf';982u4k;9u2349;huf8 kij;9238u;98ur23;jfwf;03i24 I need to replace
Ok so I have a text file that will change regularly that I need
I have a file full of records ...each record is 34 lines long. I
I have large text files upon which all kinds of operations need to be

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.