Android Question Parse.com date type column

brelto85

Active Member
Licensed User
Longtime User
I'm trying to implement a Parse back-end integration with my app
in a data browser of Parse dashboard, i've add a class that have a column with date type

if i save the data into class with parse library i get an error

this is my code

B4X:
...
po.Put("startedAt", DateTime.Date("02/03/2014"))
...

the Parse error is "com.parse.ParseException: invalid type for key startedAt, expected date, but got string"

In B4A not exists the date type?
 

eps

Expert
Licensed User
Longtime User
This :

15.png
DateParse (Date As String) As Long

Parses the given date string and returns its ticks representation.
An exception will be thrown if parsing fails.
Example:
Dim SomeTime As Long
SomeTime = DateTime.DateParse("02/23/2007")

From here : http://www.b4x.com/android/help/core.html#datetime_dateparse
 
Upvote 0

brelto85

Active Member
Licensed User
Longtime User
already tried
in this case the error is "com.parse.ParseException: invalid type for key startedAt, expected date, but got long"
probably i'll have to change the type in Parse
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Sorry, my mistake - there is no 'date' type in B4A. It's usually represented as a String or Ticks (which are long).

Are you able to change the service you supply the date to? to accept a string or ticks and then convert?
 
Upvote 0

brelto85

Active Member
Licensed User
Longtime User
with number type's column in Parse class and DateTime.Now in B4A it works but the value of date column saved is "1396190338537" (for 30/03/2014..)
how to save the date type using B4A? B4A accepts the date type?
 
Upvote 0
Top