Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spring data rest format date

import java.sql.Date;
import java.sql.Time;
@Entity
public class Order{
  //format time
  @JsonFormat(pattern="HH:mm:ss")
  private Time orderTime;
  //forma date
  @JsonFormat(pattern="yyyy-MM-dd")
  private Date orderDate;
}
//if you are using spring data rest you can send a POST request like this
/*
{
  "orderTime":"20:00:00",
  "orderDate":"2022-01-01"
}
*/
Happy conding (●'◡'●) 
Comment

PREVIOUS NEXT
Code Example
Java :: nums.add to add the number to the array in java sample 
Java :: leetcode 416 
Java :: java max from 3 parameters 
Java :: character to lower java 
Java :: convert string to sql date in java 
Java :: jdbc maven dependency 
Java :: java test file exist 
Java :: java initialize float to zero 
Java :: add text to jlable 
Java :: separate string by comma java 
Java :: how to add image in title bar in android 
Java :: how to read from a txt file in java 
Java :: print colored text java 
Java :: IntStream.generate 
Java :: how to play audio files java 
Java :: keytool error: java.io.IOException: keystore password was incorrect java.io.IOException: keystore password was incorrect flutter 
Java :: hide actionbar android 
Java :: String array into LinkedList java 
Java :: how to declare list of object in java as constant 
Java :: how to iterate hashset in java 8 
Java :: unable to find bundled java version. flutter 
Java :: cloning of list in java 
Java :: array to arraylist 
Java :: java get number of days in month 
Java :: password encryption and decryption in java 
Java :: java get random char from alphabet 
Java :: android hide system bar programmatically 
Java :: java get ip address 
Java :: android vibrate device 
Java :: check if all values are same in list java 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =