String convert in Date
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: String convert in Date

Hybrid View

  1. #1
    Join Date
    Feb 2010

    String convert in Date

    Hello Everybody,
    I have a CString and it is like "[CPLM]......27.12.1999" and I would like to convert string (27.12.1999) in Date , because I need 27.12.1999 for some calculations.
    I have just tryed to work with ParseDateTime(), but it did not worked.

    If you could help me , I will be very happy
    thank you very much

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Wallisellen (ZH), Switzerland

    Re: String convert in Date

    COleDateTime::ParseDateTime always worked for me.
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2008

    Re: String convert in Date


    One thing to watch out for is the locale, your example isn't using US date format. From MSDN "Note that the locale ID will also affect whether the string format is acceptable for conversion to a date/time value"


Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This a survey!

On-Demand Webinars (sponsored)