Home Sending DATE/TIMESTAMP from device to REST service
Reply: 0

Sending DATE/TIMESTAMP from device to REST service

user957 Published in June 18, 2018, 7:40 am

I am trying to send a date and time to my SQL oracle database through my REST service. However, the field in the SQL database is getting null.

Here is my code to get the date and time:

 public void getCurrentDateandTime() throws ParseException {
    Calendar c = Calendar.getInstance();
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    currentDateandTime = dateFormat.format(c.getTime());
    CDAT = dateFormat.parse(currentDateandTime);

In my REST service, this field is specified as a date datatype, however my the temporal I am using is TIMESTAMP as I want to get the date and time.

When I use postman sending through test data like this:

"createdTimestamp": "2018-02-12T09:27:39"

It is being received and shown in my SQL database.

Why is the date I am sending from Android receiving null?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.389967 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO