Operasi Date & Time di JAVA

  1. /*
  2. * Project ini adalah karya Abdul Aziz (www.farazinux.wordpress.com)
  3. * Tidak diperkenankan merubah sourcecode tapa ijin
  4. * Tapi tidak didilarang mengembangkan. Yuk terus belajar dan berkarya
  5. *  Error dan kerusakan yang diakibatkan script ini tidak menjadi tanggungan penulis
  6. */
  7. package Tanggal;
  8. import java.text.SimpleDateFormat;
  9. import java.util.Date;
  10. /**
  11. *
  12. * @author farazinux
  13. */
  14. public class SimpleDateFormatDemo {
  15. public static void main (String args[]){
  16. Date date = new Date();
  17. SimpleDateFormat sdf;
  18. sdf = new SimpleDateFormat(“dd MMMM yyyy”);
  19. System.out.println(sdf.format(date));
  20. sdf = new SimpleDateFormat(“ddMMyyyyhhmmss”);
  21. System.out.println(sdf.format(date));
  22. }
  23. }
  24. http://farazinux.wordpress.com/2009/02/18/operasi-date-time-di-java/
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s