Here you can find the source of nowUtc(String pattern)
public static String nowUtc(String pattern)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { /**/*from ww w .jav a 2 s. c om*/ * Returns the current system date as string with the specified format */ public static String nowUtc(String pattern) { final SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); return dateFormat.format(now()); } /** * Returns the current system date */ public static Date now() { return new Date(); } /** * Returns the current system date as string with the specified format */ public static String now(String pattern) { return new SimpleDateFormat(pattern).format(now()); } }