Here you can find the source of toExtendedTime(Date date)
Parameter | Description |
---|---|
date | the date object to convert. |
public static String toExtendedTime(Date date)
//package com.java2s; /*//from w ww.j a v a2 s. c om * Copyright (c) 2004 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial API and implementation */ import java.text.SimpleDateFormat; import java.util.Date; public class Main { /** * Formats the time portion of the given date in ISO8601 compatible format * with delimiters. * * @param date the date object to convert. * * @return String representing the time portion of the date in HH:mm:ss * format. */ public static String toExtendedTime(Date date) { SimpleDateFormat formatter = new SimpleDateFormat("HH':'mm':'ss"); return formatter.format(date); } }