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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:26:13+00:00 2026-06-11T18:26:13+00:00

I want to start creating programs on my own, however my c/c++ skills are

  • 0

I want to start creating programs on my own, however my c/c++ skills are still very basic.

I’m really interested in creating a program that tells you your time according to the time zone you enter

for example:

Please enter time zone:
eastern time
Your time zone is GMT -5:00
Your current time is 12:19 pm
Would you like to try another?(y/n)

something along those lines. Eventually I want to be able use this knowledge and apply it to creating some basic free throw around apps that you mess around with and look nice. And ultimately I want to be able to apply this (and of course many other important features) to when i start developing video games, or other software,

in this case save files they have time stamps most likely applied via the machine it’s using but how does it access that?.

ive looked into various functions found on cplusplus library and i’ve come across some functions

“localtime”
“gmtime”
and “time” (for getting current time etc)

but I want to know how these functions are made, the process, the formulas they used. How do i even go about thinking to create something like that.

I even looked up how time zones are calculated and i got “Each line of longitude has a 15 degree difference and every 15 degree is 1 hour different” – Wiki Answers.

this is just some pondering I’ve had for a couple days.

So I plan to do this using C++ and primarily windows based machines (not sure if it makes a difference whether it’s OSX or Unix/Linux or Windows)

All help is greatly appreciated,

thanks!

Umeed

  • 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-11T18:26:14+00:00Added an answer on June 11, 2026 at 6:26 pm

    You will want to take a look at the official documentation for these functions. In UNIX environments (such as Cygwin on Windows), which I’d heavily recommend for development, you can get the documentation of any C standard function via the man system, e.g. by typing man 3 time, or man gmtime. On Windows, at least as far as I know, there is no such documentation system, you’ll just have to google the documentation to the function.

    The time() method is defined in the header file <ctime> (or, for pure C, <time.h>). It will return the number of seconds that have passed since 1970-01-01 00:00 UTC (GMT +0). This is also known as the UNIX time. It is a pretty simple task to calculate the actual date (year, month, day, hour, minute, second) from that value (you’ll just have to consider leap years, etc.). If you wish to know the time for a different timezone, such as GMT +1, just add 3600 * <your timezone offset here> to the value returned by time().

    The method time() is internally implemented in your C standard library, or directly as a system call in your Operating System’s Kernel, which in turn calculates the time from your motherboard’s Real-Time-Clock, which is powered by the CMOS battery to keep track of time even when your PC is switched off and disconnected from it’s power supply.

    You’ll also want to make sure that you always use standard C methods, instead of Windows-Only methods, to ensure portability of your code.

    edit

    The C++11 standard, which is mostly supported by the most recent versions of the gcc and Microsoft compilers, also provides a new standard way of getting time: std::chrono. std::chrono supports microsecond accuracy, as opposed to the second accuracy of time().

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

Sidebar

Related Questions

I want to program the basic CRUD operations of caching (creating new object ,
I want to start a calculation task that will last for a couple of
I want to start coding in Python or Ruby. Since I own a Lego
I want to start an application which will use ajax push, however the web
I am creating a program that will run an experiment on a user. It
We have a fairly simple program that's used for creating backups. I'm attempting to
I'm currently creating a program in C# that would look for the lowest possible
I want to start a simple program when windows start but I don't want
The program that I want achieve here is to construct a tree by hard
I want to create something similar to TextExpander - a macro program that watches

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.