iOS Question Get the tick value of a date string

ciginfo

Well-Known Member
Licensed User
Longtime User
Is this code right? I want to obtain the tick value of a date "Thedate" registered in a database as date (AAAA-MM-JJ). It seems it does not work.
What is the the syntax of "DateTime.DateTimeParse(Mydate,"")" if I want only date and not time. (I have not time in the database)

B4X:
Dim  Mydate, Newdate, As Long
Mydate = M.Get("Thedate")
DateTime.DateFormat="AAAA-MM-JJ"
DateTime.TimeFormat="H:mma"
Newdate = DateTime.DateTimeParse(Mydate,"")
 

ciginfo

Well-Known Member
Licensed User
Longtime User
Error parsing: 2015
See on attached image
 

Attachments

  • error2.png
    error2.png
    28.2 KB · Views: 208
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
In fact, DateDebut is in my database phpmyadmin as a date (yyyy-MM-dd). There is not variable as date in B4i and i don't know if i have to consider DateDebut as a long or as a string. It seems i have to consider as a string.
 
Upvote 0
Top