03
Aug
07

Tanggal String, cukup fleksibel

Potongan kode untuk membuat tanggal yang cukup fleksibel.

Pseudocode:

{….}

Calendar cal = Calendar.getInstance(TimeZone.getDefault());

String TIME_FORMAT = “yyyy-MM-dd”;

java.text.SimpleDateFormat stf = new java.text.SimpleDateFormat(TIME_FORMAT);

stf.setTimeZone(TimeZone.getDefault());

String tglTransaksi = stf.format(cal.getTime());

{….}

Advertisements

0 Responses to “Tanggal String, cukup fleksibel”



  1. Leave a Comment

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


%d bloggers like this: