Print time unit.

@param value TimeUnit instance
@return time unit value
193430
public static final BigInteger printTimeUnit(TimeUnit value)
   {
      return (BigInteger.valueOf(value == null ? TimeUnit.DAYS.getValue() + 1 : value.getValue() + 1));
   }
11058
public static final Date parseTimestamp(String value)
   {
      Date result = null;

      if (value != null && value.length() != 0)
      {
         try
         {
            result = TIMESTAMP_FORMAT.get().parse(value);
         }

         catch (ParseException ex)
         {
            // Ignore parse exception
         }
      }

      return (result);
   }
1244835
function convertTime(value, fromUnit, toUnit)
{
    if(fromUnit != toUnit && value !== 0)
    {
        return value * (toUnit == 's'? 0.001 : 1000);
    }
    return value;
}
1108844
public static Date asDate(Object value) {
        if (value instanceof Date) {
            return (Date) value;
        } else if (value instanceof CharSequence) {
            String date = value.toString().trim();
            try {
                LocalDateTime time;
                if (date.endsWith("Z")) {
                    time = LocalDateTime.parse((CharSequence) value,
                                               DateTimeFormatter.ISO_INSTANT.withZone(Clock.systemUTC().getZone()));
                } else {
                    time = LocalDateTime.parse((CharSequence) value,
                                               DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(Clock.systemUTC().getZone()));
                }
                return new Date(time.atZone(Clock.systemUTC()
                                                 .getZone()).toInstant().toEpochMilli());
            } catch (RuntimeException e) {
                throw new ConfigException(e, "Unable to parse date: " + e.getMessage());
            }
        } else if (value instanceof Long) {
            // Longs are assumed to be java time (millis since epoch).
            return new Date((Long) value);
        } else if (value instanceof Integer) {
            // Integers are assumed to be unix time (seconds since epoch).
            return new Date(((Integer) value).longValue() * 1000L);
        } else {
            throw new IncompatibleValueException("Unable to convert " + value.getClass().getSimpleName() + " to a date");
        }
    }
135126
def to_seconds(value, time_unit):
        
        if isinstance(value, bool):
            # bool is a subclass of int. Don't let bool and float multiplication.
            raise TypeError
        return float(value) * time_unit
751645
public String marshal(Date value) {
		
		if(value == null){
			return null;
		}
		
		return formatter.print(new DateTime(value));

	}
494805
public static java.util.Date getDateTime(Object value) {
        try {
            return toDateTime(value);
        } catch (ParseException pe) {
            pe.printStackTrace();
            return null;
        }
    }
198144
public static ZonedDateTime zonedDateTimeOf(final String value) {
        try {
            return ZonedDateTime.parse(value);
        } catch (final Exception e) {
            return null;
        }
    }
267351
public TimeFormat getFormat(TimeUnit unit)
   {
      if (unit != null && units.get(unit) != null)
      {
         return units.get(unit);
      }
      return null;
   }
405025
private String formatTimeUnit(TimeUnit timeUnit)
   {
      int units = timeUnit.getValue();
      String result;
      String[][] unitNames = LocaleData.getStringArrays(m_locale, LocaleData.TIME_UNITS_ARRAY);

      if (units < 0 || units >= unitNames.length)
      {
         result = "";
      }
      else
      {
         result = unitNames[units][0];
      }

      return (result);
   }
614830
final String removeUnit(String value)
	{
		final int i;
		if (dpt.getUnit().length() > 0 && (i = value.lastIndexOf(dpt.getUnit())) > -1)
			return value.substring(0, i).trim();
		// java number parsing routines are really picky, remove WS
		return value.trim();
	}
1322648
public static String print(final Object value) {
        if (value == null) {
            return "null";
        }
        if (value instanceof String) {
            return '"' + value.toString() + '"';
        }
        if (value instanceof Character) {
            return printChar((Character) value);
        }
        if (value instanceof Long) {
            return value + "L";
        }
        if (value instanceof Double) {
            return value + "d";
        }
        if (value instanceof Float) {
            return value + "f";
        }
        if (value instanceof Short) {
            return "(short) " + value;
        }
        if (value instanceof Byte) {
            return String.format("(byte) 0x%02X", (Byte) value);
        }
        if (value instanceof Map) {
            return printMap((Map<?, ?>) value);
        }
        if (value.getClass().isArray()) {
            return printValues("[", ", ", "]", new Iterator<Object>() {
                private int currentIndex = 0;

                public boolean hasNext() {
                    return currentIndex < Array.getLength(value);
                }

                public Object next() {
                    return Array.get(value, currentIndex++);
                }

                public void remove() {
                    throw new UnsupportedOperationException("cannot remove items from an array");
                }
            });
        }
        if (value instanceof FormattedText) {
            return (((FormattedText) value).getText());
        }

        return descriptionOf(value);
    }
554327
def _time_string(self, value):
        
        if self.max_time < 60:
            return "%02d" % (value)
        elif self.max_time < 3600:
            mm = value // 60
            ss = value - mm * 60
            return "%02d:%02d" % (mm, ss)
        hh = value // 3600
        mm = (value - hh * 3600) // 60
        ss = (value - hh * 3600 - mm * 60)
        return "%02d:%02d:%02d" % (hh, mm, ss)
232967
public static java.sql.Time toTime(Object value) throws ParseException {
        if (value == null) {
            return null;
        }
        if (value instanceof java.sql.Time) {
            return (java.sql.Time) value;
        }
        if (value instanceof String) {
            if ("".equals((String) value)) {
                return null;
            }
            return new java.sql.Time(IN_TIME_FORMAT.parse((String) value).getTime());
        }

        return new java.sql.Time(IN_TIME_FORMAT.parse(value.toString()).getTime());
    }
1199978
private TimeUnit getFormat(int format)
   {
      TimeUnit result;
      if (format == 0xFFFF)
      {
         result = TimeUnit.HOURS;
      }
      else
      {
         result = MPPUtility.getWorkTimeUnits(format);
      }
      return result;
   }
663263
public static final Number parseUnits(Number value)
   {
      return (value == null ? null : NumberHelper.getDouble(value.doubleValue() * 100));
   }
277131
public double convert(double time, TimeUnit from, TimeUnit to) {
        return time * factorOf(to) / factorOf(from);
    }