CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2007
    Posts
    23

    Convert ctime() string to tm struct?

    What I'm wanting to do it take a ctime() string and convert it to a tm struct. I know I can do this manually, but it seems like there should already be a function to do this.
    ctime() returns a string in the format of Www Mmm dd hh:mm:ss yyyy.

  2. #2
    Join Date
    Dec 2008
    Posts
    56

    Re: Convert ctime() string to tm struct?

    The use of ctime() requires a time_t parameter. Why do you not use that same time_t parameter in either gmtime() or localtime() to yield the struct tm?

    If that is not an option, then just use strptime().

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured