Thread: Export/Importing Time

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    491

    Export/Importing Time

    Hello, I'm making a program which needs to export a the time (not necesarly the current time) to a file in a way so that if it the file is moved to a computer of different endian or time zone, the value can be read in correctly. Does anyone have a general idea of what I should do. Currently my idea is to use strftime to write the time out, and either make my own function or use strptime to read it back in. Does this seem like a good approach? The values I write to the file does not necesarly need to be human readable, so I was thinking of converting the time_t to a string and putting that into a file, but is it safe to assume time_t is just a number on all machines?

    Any ideas are appreciated, thanks.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    As long as it works at a decent speed it sounds good to me.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. Replies: 11
    Last Post: 03-29-2009, 12:27 PM
  3. calculating user time and time elapsed
    By Neildadon in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2003, 06:00 PM
  4. 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, 06:17 PM
  5. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 10:12 PM