package com.gmgauthier.springboot; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import java.text.SimpleDateFormat; import java.util.Date; @RestController @EnableAutoConfiguration public class HelloWorldController { @RequestMapping("/") @ResponseBody String hello() { return "

Hello World!

\n

Spring boot is so simple.

"; } @RequestMapping("/date") @ResponseBody String time() { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z"); Date date = new Date(System.currentTimeMillis()); String strDate = formatter.format(date); return "

The Current Date is:" + strDate + "

"; } }