Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] 현재 날짜 및 시간 자동 저장 관련 개선 #6

Closed
geesuee opened this issue Oct 11, 2021 · 0 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@geesuee
Copy link
Contributor

geesuee commented Oct 11, 2021

개선 전 상황

현재 날짜 및 시간을 자동으로 파악하여 저장하는 기능 관련하여
기존에 사용했던 java.util.Date에 비해 java.time.LocalDate / java.time.LocalDateTime 사용이 보다 편리하다고 느꼈습니다.
(java8 이후로 java.util.Date를 잘 쓰지 않는다는 이야기도 있었습니다.)


개선 내용

  • Review의 경우 후기 작성 날짜와 시간이 모두 필요하여 기존 Date 타입이었던 변수 dateTime을 LocalDateTime으로 변경
  • 현재 날짜가 기록되어야하는 경우, LocalDate로 변경 가능
  • 현재 시간이 기록되어야하는 경우, LocalTime으로 변경 가능
  • Controller에서는 LocalDateTime dateTime = LocalDateTime.now();와 같은 형식으로 현재 날짜 및 시간 할당 가능
    +) 자동적으로 입력되는(현재 날짜/시간) 값의 경우 DTO로 받아올 필요가 없기 때문에 DTO에서 해당 변수 삭제하시면 됩니다.
@geesuee geesuee added the bug Something isn't working label Oct 11, 2021
@geesuee geesuee self-assigned this Oct 11, 2021
@do-oni do-oni pinned this issue Oct 11, 2021
@geesuee geesuee closed this as completed Oct 12, 2021
@geesuee geesuee changed the title [BUG] 현재 날짜 및 시간 자동 저장 관련 개선 [ENHANCEMENT] 현재 날짜 및 시간 자동 저장 관련 개선 Oct 12, 2021
@geesuee geesuee added enhancement New feature or request and removed bug Something isn't working labels Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant