iOS Question [resolved] DateTime.DateParse giving negative

Discussion in 'iOS Questions' started by stingrae, Nov 9, 2018 at 10:30 AM.

  1. stingrae

    stingrae Member Licensed User

    Sorry to ask, as this is probably something really silly, but has been driving me nuts for about 30 minutes ...

    In the code below, why is intD coming back with a value of -643259264 ?

    Code:
    DateTime.DateFormat = "dd-MMM-yyyy"
            
    Dim strD As String = "04-Nov-2018"
            
    Dim intD As Int = DateTime.DateParse(strD)
            
    Log(intD)
    Thanks in advance
     
  2. klaus

    klaus Expert Licensed User

    DateTime.DateParse(strD) returns a Long type variable.
    Therfore: Dim longD As Long = DateTime.DateParse(strD)
     
    stingrae and BillMeyer like this.
  3. stingrae

    stingrae Member Licensed User

    d'oh ... knew it had to be simple!
    Thank you :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice