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

Thread: String convert in Date

  1. #1
    Join Date
    Feb 2010
    Posts
    1

    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
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,421

    Re: String convert in Date

    COleDateTime::ParseDateTime always worked for me.
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2008
    Location
    Scotland
    Posts
    379

    Re: String convert in Date

    Hi,

    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"

    Alan

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 is a CodeGuru survey question.


Featured


HTML5 Development Center