Guest User

Untitled

a guest
Jun 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import java.util.Date;
  2. import java.io.IOException;
  3. import java.io.FileWriter;
  4. import java.text.SimpleDateFormat;
  5.  
  6. public class Bla {
  7. public static void main(String[] args) {
  8. Date date = new Date();
  9. SimpleDateFormat form = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss z");
  10. String mes = "\n" + form.format(date);
  11. System.out.println(mes);
  12. try {
  13. FileWriter logger = new FileWriter("server.log", true);
  14. logger.write(mes);
  15. }
  16. catch (IOException e) {
  17. System.err.println(e);
  18. }
  19. }
  20. }
Add Comment
Please, Sign In to add comment