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.