Skip to content

Commit

Permalink
Updando código do M03
Browse files Browse the repository at this point in the history
  • Loading branch information
fkeglevich committed Aug 23, 2018
1 parent 5810a55 commit c32fc7b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/hello/HelloController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.joda.time.LocalTime;
import org.joda.time.*;
import org.joda.time.format.*;

@RestController
public class HelloController {

@RequestMapping("/data")
public String index() {
LocalTime currentTime = new LocalTime();
return "Greetings from Spring Boot!" + currentTime; //"<html><body>Greetings from <i>Spring Boot!</i></body></html>";

DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd HH'h'mm");

DateTime currentTime = new DateTime();

return "Greetings from Spring Boot! " + formatter.print(currentTime); //"<html><body>Greetings from <i>Spring Boot!</i></body></html>";
}

}

0 comments on commit c32fc7b

Please sign in to comment.