linux的man页中对gettimeofday函数的说明中,有这样一个说明: $ man gettimeofday DESCRIPTION The functions gettimeofday and settimeofday can get and set the time as well as a timezone. The tv argument is a timeval struct, as specified in <sys/time.h>:
public class Time { public static void main(String[] args) { Date t = new Date(); DateFormat ti = new SimpleDateFormat("yyyy年MM月dd日 hh:mm:ss"); String s = ti.format(t); System.out.println("现在是佛山时间:"+s); }}