You could try a combination of strptime and mktime
struct tm tm;
time_t epoch;
if ( strptime(timestamp, "%Y-%m-%d %H:%M:%S", &tm) != NULL )
epoch = mktime(&tm);
else
// badness
More Related Contents:
- printf anomaly after “fork()”
- How to make child process die after parent exits?
- How to send a simple string between two programs using pipes?
- stat() error ‘No such file or directory’ when file name is returned by readdir()
- Why does this program print “forked!” 4 times?
- stdout thread-safe in C on Linux?
- Linking two shared libraries with some of the same symbols
- Please explain the exec() function and its family
- Non-blocking call for reading descriptor
- Why does ENOENT mean “No such file or directory”?
- How can I copy a file on Unix using C?
- Using SO_REUSEADDR – What happens to previously open socket?
- Turn a simple socket into an SSL socket
- After forking, are global variables shared?
- What are the differences between poll and select?
- practical examples use dup or dup2
- Calculating elapsed time in a C program in milliseconds
- Waiting for all child processes before parent resumes execution UNIX
- Recursive mkdir() system call on Unix
- fork and existing threads?
- Why the address of variable of child process and parent process is same
- Programmatically retrieving the absolute path of an OS X command-line app
- Seeking a simple description regarding ‘file descriptor’ after fork()
- Dropping root privileges
- In C, what’s the size of stdout buffer?
- To check the E2BIG error condition in exec
- What can cause a “Resource temporarily unavailable” on sock send() command
- Reading from stdin
- Unix O_CREAT flag without mode specified
- Why can’t I ignore SIGSEGV signal?