Retrieves date value stored as long.
324335
@Nullable
    public static Date getDate(@NonNull SharedPreferences prefs, @NonNull String key) {
        long time = prefs.getLong(key, Long.MIN_VALUE);
        return time == Long.MIN_VALUE ? null : new Date(time);
    }
55025
@Override
	public Long getPropertyLong(String key, Long aDefault)
	{
		Long longValue = null;
		
		String sVal = getProperty(key,false);
		if ((sVal != null) && (sVal.length() > 0))
		{
			longValue = Long.valueOf(sVal);
		}
		else
		{
			longValue = aDefault;
		}
		return longValue;

	}
1259381
public LongConstant getLongByValue(long value)
  {
    for (int i = 0; i < _entries.size(); i++) {
      ConstantPoolEntry entry = _entries.get(i);

      if (! (entry instanceof LongConstant))
        continue;

      LongConstant longEntry = (LongConstant) entry;

      if (longEntry.getValue() == value)
        return longEntry;
    }

    return null;
  }
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");
        }
    }
702260
public T getValue ()
    {
        // if the value is still around and it's expired, clear it
        if (_value != null && System.currentTimeMillis() >= _expires) {
            _value = null;
        }
        // then return the value (which may be cleared to null by now)
        return _value;
    }
220670
@Override
	public Date deserialize(Long value) {
		if (value != null) {
			return new Date(value);
		}
		return null;
	}
1159836
protected long getLong()
  {
    if (tc.isEntryEnabled()) Tr.entry(tc, "getLong",this);

    long data = _buffer.getLong();

    if (tc.isEntryEnabled()) Tr.exit(tc, "getLong", new Long(data));
    return data;
  }
15105
def _getFromDate(l, date):
    '''
    
    '''
    try:
        date = _toDate(date)
        i = _insertDateIndex(date, l) - 1
        if i == -1:
            return l[0]
        return l[i]
    except (ValueError, TypeError):
        # ValueError: date invalid / TypeError: date = None
        return l[0]
431282
public static Date getDateFromLong(long date)
   {
      TimeZone tz = TimeZone.getDefault();
      return (new Date(date - tz.getRawOffset()));
   }
633493
public String getMaxDateCreated() {

        if (m_searchParams.getMaxDateCreated() == Long.MAX_VALUE) {
            return "";
        }
        return Long.toString(m_searchParams.getMaxDateCreated());
    }
190667
public static Long toLong(Object value, Long defaultValue) {
		return convert(Long.class, value, defaultValue);
	}
841556
public Long getLong(String key, long aDefault)
   {
      return getLong(key, Long.valueOf(aDefault));
   }
726345
def _get_date(self, decrypted_content):
        """"""
        
        # Just copied from original KeePassX source
        date_field = struct.unpack('<5B', decrypted_content[:5])
        dw1 = date_field[0]
        dw2 = date_field[1]
        dw3 = date_field[2]
        dw4 = date_field[3]
        dw5 = date_field[4]

        y = (dw1 << 6) | (dw2 >> 2)
        mon = ((dw2 & 0x03) << 2) | (dw3 >> 6)
        d = (dw3 >> 1) & 0x1F
        h = ((dw3 & 0x01) << 4) | (dw4 >> 4)
        min_ = ((dw4 & 0x0F) << 2) | (dw5 >> 6)
        s = dw5 & 0x3F
        return datetime(y, mon, d, h, min_, s)
367159
public long getLong(final String name, final long defaultValue) {
    if (containsKey(name)) {
      return Long.parseLong(get(name));
    } else {
      return defaultValue;
    }
  }
603919
public long getLong(String key, long defaultValue) {
    Object value = get(key);
    if (value instanceof Long) {
      return (long) value;
    }
    if (value instanceof Number) {
      return ((Number) value).longValue();
    } else if (value instanceof String) {
      try {
        return Long.valueOf((String) value);
      } catch (NumberFormatException ignored) {
      }
    }
    return defaultValue;
  }
530579
public static Long getLong(ValueData valueData) throws RepositoryException
   {
      if (valueData instanceof TransientValueData)
      {
         return getLong(((TransientValueData)valueData).delegate);
      }
      
      return ((AbstractValueData) valueData).getLong();
   }
390087
public static long parseDate(String value) {
        Date date = null;
        for (SimpleDateFormat format : FORMATS_TEMPLATE) {
            try {
                date = format.parse(value);
            } catch (ParseException e) {
                // Nothing.
            }
        }

        if (date == null) return -1L;
        return date.getTime();
    }