Here you can find the source of now()
private static String now()
//package com.java2s; /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSZ"); private static String now() { String now = dateFormat.format(new Date()); now = now.substring(0, 26) + ":" + now.substring(26, 28); return now; }/*from w w w . j av a 2 s . co m*/ }