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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:23:27+00:00 2026-05-24T22:23:27+00:00

I have a class that needs to contain a time variable. How to do

  • 0

I have a class that needs to contain a time variable. How to do that? I would like to specify that I communicate with a server and as a response at time section I receive for example: 2011-07-01T14:32:39+02:00 .APPRECIATE. THX

P.S I would like to use the C++ API.

  • 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-24T22:23:30+00:00Added an answer on May 24, 2026 at 10:23 pm

    There are several solutions each with another drawback. One would be to just calculate the timestamp and save it as a number. Another would be to use boost date_time (which I would prefer if you can introduce a dependency to boost).
    It all very much depends on what you need to do with the time. If you only need to save it and don’t need to do calculations on it, may be even a std::string would be good enough. If you need to do very simple operations on it, a timestamp is probably good enough and the simplest way (however you still have the burden to parse it). For complex stuff boost would be my preferred way to go.

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

Sidebar

Related Questions

I have one class that needs to grab an attribute that is set in
If I have a class that needs to implement an interface but one or
I have a session class that needs to store session information in a MySQL
I have a generic class that needs to limit an enum depending on the
If you have data for a class that will be modified and needs to
I have a class that I need to binary serialize. The class contains one
I have a class that I need to perform some actions on but I
I have a class that I need to be able to serialize to a
I have a class that has a property that I need to stub. I
I have a simple Java class that I need to serialize to be stored

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.