Spring 3.1 JSON date format

后端 未结 3 1690
挽巷
挽巷 2020-11-30 00:45

I am using annotated Spring 3.1 MVC code (spring-mvc) and when i send date object through the @RequestBody the date is showing up as numeric. This is my controller

3条回答
  •  甜味超标
    2020-11-30 01:10

    Alternatively if you are using jackson and want an ISO-8601 date on all dates (not just those you annotate), you can disable the default of writing dates as timestamps.

    
    
    
        
        
        
            
                WRITE_DATES_AS_TIMESTAMPS
            
        
    
    

    Then if you want to convert your dates into some other format than the default, you can do this:

    
        
        
        
            
              
                
              
            
        
    
    

提交回复
热议问题