ParseExact function does not work as expected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Karim Saikali
    New Member
    • Oct 2016
    • 3

    ParseExact function does not work as expected

    Hi All,

    I am using Visual Studio 2015 Visual Basic Net with a target framework 4.6.1

    The parseexact function is returning a format exception error whereas all parameters are well set ! I really dont see what is missed here :(

    Really appreciated some help

    Dim frFR As New CultureInfo("fr-FR")
    MySFromDB = "Dim 15 Jui 2008 17:30 -06:00"
    Form = "ddd dd MMM yyyy hh:mm zzz"
    Try
    result = Date.ParseExact (MySFromDB, Form, frFR) ' #6/15/2008 05:30:00 PM#
    Catch ex As Exception
    MsgBox("Hi")
    End Try
  • Oralloy
    Recognized Expert Contributor
    • Jun 2010
    • 988

    #2
    Two Suggestions

    Karim Saikali,

    Did you look at what the exception says?

    I don't know the exact conversion characters, but the "ddd" sequence you have at the head of your format is probably rejecting on the character sequence "Dim".

    Cheers,
    Oralloy

    Comment

    Working...