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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:43:57+00:00 2026-06-13T17:43:57+00:00

So I am using function to get the time from time with an offset

  • 0

So I am using function to get the time from time with an offset of 555550 which should give a value of 10:19:09. But when I use gmtime and asctime I get a value of 10 seconds instead of 9 seconds, and I don’t understand why I am one second off. Could anyone please explain this?

Here is the code I am testing:

#include <stdio.h>
#include <time.h>

int main (void) 
{
    time_t now = 555550;
    printf ("The time is %s", asctime (localtime (&now)));
    printf ("UTC time is %s", asctime (gmtime (&now)));
    return 0;
}
  • 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-13T17:43:58+00:00Added an answer on June 13, 2026 at 5:43 pm

    your calculation is wrong: see http://www.epochconverter.com/. 10 seconds is correct. How would a number divisible by 10 end up as 9 when modded by 60?

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

Sidebar

Related Questions

I'm trying to get the time from a Bootstrap Timepicker using the getTime function,
Dear all i am using this function to get the GMT time, i am
I am trying to get double values from file using fscanf function. I am
I want to get clients Time Zone offset from his IP address for my
I am using the following code to get time from the server. The btnNoP
I am using the following function to get the Time using javascript: function timeMil(){
I have a function to get the current time using the unix gettimeofday() in
I am using this function to get the featured images: <a href=# rel=prettyPhoto> <?php
I am using a library function called get_count_and_price which returns a 2-tuple (count,price). In
i want to read an html file by using jquery get function, replace some

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.