Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spring data rest format time

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 :: java array swap 
Java :: java intercept ctrl c 
Java :: frequency of number in java using hashmap using getordefault 
Java :: entryset in java loop 
Java :: java print type of object 
Java :: how to get date android studio 
Java :: clear back stack android 
Java :: Date from String java3 
Java :: spring get bean with generic type 
Java :: java par o impar 
Java :: java close tcp socket output stream but not socket 
Java :: java sha256 hex digest 
Java :: character.isalphanumeric java 
Java :: Which of the following is the only Java package that is imported by default? 
Java :: how to set 2 decimal places in java 
Java :: java http request post 
Java :: how to test how many of one character is in a string java 
Java :: play sound on button click android studio 
Java :: Unable to find bundled Java version. 
Java :: convert ascii to string java 
Java :: Java Using forName() method 
Java :: convert string to byte java 
Java :: how to initialize an array in java 
Java :: android videoview setup 
Java :: java print output 
Java :: slice array java 
Java :: java stack 
Java :: get month from int java 
Java :: java transfer file over socket 
Java :: how to make an int into a string java 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =