DonManfred Expert Licensed User Longtime User Dec 5, 2014 #1 Hello, for the Dropbox-SDK i need to read a date (java) from the datastore and get them in a b4a long (to use as date) And i want to set a b4a long (datetime.now for example) into a datastore as java date. i wrote the subs but i want to know whether this are correct or not. Code: Copy ' b4a->java public DbxFields setDate(String name, Long value) { Date d = new Date(value * 1000); return getObject().set(name, d); } ' java->b4a public Long getDate(String name) { return getObject().getDate(name).getTime(); }
Hello, for the Dropbox-SDK i need to read a date (java) from the datastore and get them in a b4a long (to use as date) And i want to set a b4a long (datetime.now for example) into a datastore as java date. i wrote the subs but i want to know whether this are correct or not. Code: Copy ' b4a->java public DbxFields setDate(String name, Long value) { Date d = new Date(value * 1000); return getObject().set(name, d); } ' java->b4a public Long getDate(String name) { return getObject().getDate(name).getTime(); }
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2014 #2 It should be: new Date(value). Other than that it is correct.
DonManfred Expert Licensed User Longtime User Dec 7, 2014 #3 Erel said: It should be: new Date(value). Other than that it is correct. Click to expand... Thank you
Erel said: It should be: new Date(value). Other than that it is correct. Click to expand... Thank you