Giter Site home page Giter Site logo

crud-spring's Introduction

Build/Run

./mvnw spring-boot:run

Test

curl    --header "Content-Type: application/json" \
        --request POST \
        --data '{"name": "bbb","email": "[email protected]","dateOne": "2020-07-28","dateTwo": "2020-07-28","dateThree": "2020-07-28","dateFour": "2020-07-28T21:45:08","dateFive": "2020-07-28T21:45:08.969752-02:00"}' \
        http://localhost:8080/users

See log output:

2020-11-24 14:36:21.285  INFO 320 --- [nio-8080-exec-7] bcp.crud.UserController                  : Create user: 
User [id=0
, name=bbb
, [email protected]
, dateOne....(java.util.Date)...........2020-07-27 21:00:00 [Mon Jul 27 21:00:00 BRT 2020]
, dateTwo....(java.sql.Date)............2020-07-27 21:00:00 [2020-07-27]
, dateThree..(java.time.LocalDate)......2020-07-28          [2020-07-28]
, dateFour...(java.time.LocalDateTime)..2020-07-28 21:45:08 [2020-07-28T21:45:08]
, dateFive...(java.time.ZonedDateTime)..2020-07-29 00:45:08 [2020-07-29T00:45:08.969752Z[UTC]]
  {Default TZsun.util.calendar.ZoneInfo[id="America/Sao_Paulo",offset=-10800000,dstSavings=0,useDaylight=false,transitions=93,lastRule=null]} ]

Links

Info

If spring.jackson.time-zone=GMT-3 not informed, TZ data types will be threated as UTC:

  • java.util.Date (1)
  • java.sql.Date (1)
  • java.time.ZonedDateTime (2)

(1) Will receive as UTC and display (convert) in JVM TZ
(2) Will convert received TZ to UTC

crud-spring's People

Watchers

Bruno Cesar Proença avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.