brelto85 Active Member Licensed User Longtime User Mar 24, 2014 #1 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 Code: Copy ... 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?
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 Code: Copy ... 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?
NJDude Expert Licensed User Longtime User Mar 25, 2014 #2 It should be: Code: Copy DateTime.Date(DateTime.Now) Last edited: Mar 25, 2014 Upvote 0
brelto85 Active Member Licensed User Longtime User Mar 25, 2014 #3 no, DateTime.Date(DateTime.Now) return a string and generates the error already described Upvote 0
eps Expert Licensed User Longtime User Mar 25, 2014 #4 This : 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
This : 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
brelto85 Active Member Licensed User Longtime User Mar 25, 2014 #5 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
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
eps Expert Licensed User Longtime User Mar 25, 2014 #6 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
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?
brelto85 Active Member Licensed User Longtime User Mar 30, 2014 #7 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
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?