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

  • Home
  • SEARCH
  • 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 178457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:14:04+00:00 2026-05-11T14:14:04+00:00

Total newbie question here; I apologize in advance. Suppose I have a daemon written

  • 0

Total newbie question here; I apologize in advance.

Suppose I have a daemon written in C that wakes itself up every five minutes or so, does some processing if there’s anything in its input queue, and then goes back to sleep. Now suppose there is some processing that it only has to do after a certain (configurable) time–say, 2 pm (and before midnight).

In C, what is the quickest, best way to get the current time’s hour into an int variable, so that it can easily be checked against–to determine if, in fact, it is after 2pm on today?

  • 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. 2026-05-11T14:14:04+00:00Added an answer on May 11, 2026 at 2:14 pm

    localtime. See http://linux.die.net/man/3/localtime

    time_t now = time(NULL); struct tm *tm_struct = localtime(&now);  int hour = tm_struct->tm_hour; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a total newbie in ios, so judge my question by that. I have
first of all, sorry if that question is dumb but I´m a total newbie
A total newbie question, so please bear with me here ;) When a key
Total newbie question now... Suffice to say, I have searched for a completely noddy
Total newbie Iphone/ Obj. C question: I have a class called Location, in the
This is a total newbie question, so thanks in advance. I'm trying to get
this is a newbie question I have the following code: var total = 0L
Total newbie question here...Today while trying to calculate sum of a list of integers(actually
Total newbie question, but I cant figure out what im doing wrong. I want
I know this is a total newbie question, but the answer may not 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.