Converting time

This is a discussion on Converting time within the C++ Programming forums, part of the General Programming Boards category; Is there an easy way to convert time to different formats? For example, I have the current date/time that is ...

  1. #1
    Registered User mepaco's Avatar
    Join Date
    Aug 2002
    Posts
    47

    Converting time

    Is there an easy way to convert time to different formats? For example, I have the current date/time that is represented by the number of seconds that have elapsed since 00:00:00 Jan. 1, 1970 and want to convert it to a nice form to show the user. I wrote a function that does it but thought I would see if there was an easier way of doing it.

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    time.h has a number of functions that may be helpful. Many of the functions in it use structs, but once you figure that out, there are a lot of standard functions premade for you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Determine the closest departure time
    By Kyeong in forum C Programming
    Replies: 9
    Last Post: 10-07-2008, 09:06 PM
  2. Journey time prog 1 minute wrong
    By mike_g in forum C Programming
    Replies: 4
    Last Post: 10-12-2006, 04:41 AM
  3. Is this really true or it's just science fiction?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 145
    Last Post: 04-09-2002, 07:17 PM
  4. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21