Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > ctime format

Reply
Thread Tools

ctime format

 
 
Gary Wessle
Guest
Posts: n/a
 
      02-01-2007
Hello

I have been playing around all day on how to convert a time epoch to a
string in the format of my choice.

ctime puts out Thu Feb 1 18:32:14 2007
but I want 2007-2-1 18:32:14

any ideas, I tried with boost but it is an overkill.
// date_input_facet* inf = new date_input_facet();
// f->format("%a %b %d %H:%M:%S %Y"); // file:///usr/share/doc/boost-1.33.1/date_time/date_time_io.html
// date_output_facet* outf = new

then got stuck.

thanks
 
Reply With Quote
 
 
 
 
Mehturt@gmail.com
Guest
Posts: n/a
 
      02-01-2007
> I have been playing around all day on how to convert a time epoch to a
> string in the format of my choice.

Have a look at strftime().
m

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
who do know std::ctime() how implement? Help me? wukexin C++ 1 05-25-2005 01:44 PM
ctime Help Kevin C++ 3 05-16-2004 04:09 PM
Undestanding proper ctime and clock() usage. Oplec C++ 2 10-25-2003 11:42 PM
Question about ctime Tivo Escobar C++ 1 07-23-2003 07:29 PM
replacement for <ctime>? Ernst Murnleitner C++ 8 07-20-2003 02:40 AM



Advertisments