create a W3C Date Time representation of a date time using UTC date time
zone.

@param aDateTime
Date to print. May not be <code>null</code>.
@return the W3C Date Time represented by the given Date.
322721
@Nullable
  public static String getAsStringW3C (@Nullable final OffsetDateTime aDateTime)
  {
    if (aDateTime == null)
      return null;
    return getAsStringW3C (aDateTime.toZonedDateTime ());
  }
279516
public static TimeZone getBrowserTimeZone() {


        if (!StringUtils.isEmpty(fixedTimeZoneProperty)) {
            return TimeZone.getTimeZone(fixedTimeZoneProperty);
        }

        final WebBrowser webBrowser = com.vaadin.server.Page.getCurrent().getWebBrowser();
        final String[] timeZones = TimeZone.getAvailableIDs(webBrowser.getRawTimezoneOffset());
        TimeZone tz = TimeZone.getDefault();
        for (final String string : timeZones) {
            final TimeZone t = TimeZone.getTimeZone(string);
            if (t.getRawOffset() == webBrowser.getRawTimezoneOffset()) {
                tz = t;
            }
        }
        return tz;
    }
30880
public static final <T extends Date> Function<T, DateTime> dateToDateTime(DateTimeZone dateTimeZone) {
		return FnDateTime.dateToDateTime(dateTimeZone);
	}
906481
public static java.util.Date toDateTime(Object value) throws ParseException {
        if (value == null) {
            return null;
        }
        if (value instanceof java.util.Date) {
            return (java.util.Date) value;
        }
        if (value instanceof String) {
            if ("".equals((String) value)) {
                return null;
            }
            return IN_DATETIME_FORMAT.parse((String) value);
        }

        return IN_DATETIME_FORMAT.parse(value.toString());
    }
877966
public static String formatDateTime(Date d) {
    return formatDateTime(OffsetDateTime.ofInstant(d.toInstant(), ZoneId.systemDefault()));
  }
1217809
public static String dateTime(GregorianCalendar gc) {
		if(gc == null)return "";
		TimeZone tz = gc.getTimeZone();
		int tz1 = (tz.getRawOffset()+tz.getDSTSavings())/0x8CA0;
		int tz1abs = Math.abs(tz1);
		return String.format("%04d-%02d-%02dT%02d:%02d:%02d.%03d%c%02d:%02d", 
				gc.get(GregorianCalendar.YEAR),
				gc.get(GregorianCalendar.MONTH)+1,
				gc.get(GregorianCalendar.DAY_OF_MONTH),
				gc.get(GregorianCalendar.HOUR),
				gc.get(GregorianCalendar.MINUTE),
				gc.get(GregorianCalendar.SECOND),
				gc.get(GregorianCalendar.MILLISECOND),
				tz1==tz1abs?'+':'-',
				tz1abs/100,
				((tz1abs-(tz1abs/100)*100)*6)/10 // Get the "10s", then convert to mins (without losing int place)
				);
	}
5492
public static DateTime toDateTime(String dateTime, String timeZoneId) {
    return dateTimesHelper.toDateTime(dateTime, timeZoneId);
  }
535930
public String marshal( Date value )
    {
        String val = "";
    	if (value != null) {
        	Calendar cal = new GregorianCalendar();
        	cal.setTime( value );
        	return DatatypeConverter.printDateTime( cal );
        }
		
		System.out.println("Date value: " + value);
        return val;
    }
421375
public static final String printFinishDateTime(Date value)
   {
      if (value != null)
      {
         value = DateHelper.addDays(value, 1);
      }
      return (value == null ? null : DATE_FORMAT.get().format(value));
   }
1334399
public String timeToString(java.util.Date time, boolean withTimeZone) {
    Calendar cal = null;
    if (withTimeZone) {
      cal = calendarWithUserTz;
      cal.setTimeZone(timeZoneProvider.get());
    }
    if (time instanceof Timestamp) {
      return toString(cal, (Timestamp) time, withTimeZone);
    }
    if (time instanceof Time) {
      return toString(cal, (Time) time, withTimeZone);
    }
    return toString(cal, (Date) time, withTimeZone);
  }
966551
public static String time2DateString(java.sql.Timestamp time, Locale locale) {
        DateFormat df = DateFormat.getDateInstance(dateStyle, locale);
        return df.format(time);
    }
1246388
private static String formatUTCDateAsLocalDateTime(Date javaDate) {
    // Now back from start of day in UTC to LocalDateTime to express that we don't know the
    // timezone.
    LocalDateTime localDateTime = javaDate.toInstant().atZone(UTC).toLocalDateTime();
    // And format to string
    return localDateTime.toString();
  }
670730
public static String getDateTime(Date date, Format format) {

        StringBuffer buf = new StringBuffer();
        buf.append(getDate(date, format));
        buf.append(" ");
        buf.append(getTime(date, format));
        return buf.toString();
    }
1196495
public static final String printTime(Date value)
   {
      return (value == null ? null : TIME_FORMAT.get().format(value));
   }
1329322
public static String format( DateTimeFormat format, Date date ) {
        return format( format, UTC_TIMEZONE, date );
    }
206123
public static String format(Date time) {
        DateFormat timeFormat = new SimpleDateFormat(TimeField.FORMAT);
        return time == null ? null : timeFormat.format(time);
    }
224058
public void setTime(Date time)
    {
        String timeString = "";
        if (time != null)
    		timeString = timeFormat.format(time);
        jTextField3.setText(timeString);
        jTimeButton1.setTargetDate(time);
    }