Get Timezone offset in android

Timezone
Standard

Membuat aplikasi android yg menampilkan date membutuhkan timezone offset untuk perhitungan masing masing user time. Misalnya sebuah aplikasi berita menampilkan waktu dalam ago dibawah title. Berikut snipet untuk mendapatkan timezone offset di android. data timezone akan disertakan untuk request server, bisa sebagai sorting, atau filter yg lainnya

TimeZone tz = TimeZone.getDefault();
String current_Time_Zone = (TimeZone.getTimeZone(tz.getID()).getDisplayName(
false, TimeZone.SHORT));

return String.valueOf(tz.getRawOffset() / 60000 / 60);

semoga bermanfaat

Mengenal lebih dekat MySQL Query

Standard

Here’s my situation there’s a form to query all instructor list based some criteria :
– class periode – program
– category
– class name
– Include Instructors not assigned to any classes

final result must have this format (name, home phone, email) what schema do we have ?
instructor has one address (instructor_addresses)
instructor has many contact (instructor_contact_infos)
instructor has many class (catalog_class_instructor)

class table = catalog_classes class has one periode (periode_id)
class has (program, category) join on table catalog_class_program_category

how i m gonna accomplish this using single query send from PHP ? after an hour or so here’s the final query

optimasi mysql query

0.08 second on my mac for 2k records? not bad

green commentd line : dynamicaly insert / remove before send to mysql