Convert timestamp to date

@param dateTime timestamp
@return date
546170
public static <D extends Comparable> DateExpression<D> date(DateTimeExpression<D> dateTime) {
        return Expressions.dateOperation(dateTime.getType(), Ops.DateTimeOps.DATE, dateTime);
    }
438467
private static DateTime getDate(DateTime dateInstance, int offsetDays, int offsetMinutes) {
        return dateInstance.minusDays(offsetDays).minusMinutes(offsetMinutes);
    }
1205368
protected function getDateTime($dateTime)
    {
        if ($dateTime instanceof \DateTime) {
            return $dateTime;
        }

        if ((is_string($dateTime) && (int) $dateTime > 0) || is_numeric($dateTime)) {
            return (new \DateTime())->setTimestamp($dateTime);

        }

        throw new \common_Exception(__('A date has to be a Datetime or timestamp'));
    }
965560
def to_datetime(arg):
    


    if isinstance(arg, datetime.datetime):
        return arg
    elif arg == 0:
        return datetime.datetime.now()
    elif isinstance(arg, str):
        if arg == "now":
            arg = datetime.datetime.now()
        elif arg == "?":
            arg = datetime.datetime(1970, 1, 1)
        else:
            arg = str2dt(arg)
    elif isinstance(arg, datetime.date):
        arg = date2datetime(arg)
    elif isinstance(arg, (int, float)):
        # Suppose it is a timestamp
        arg = ts2dt(arg)
    else:
        raise TypeError("Wrong type for argument 'arg': {}".format(arg.__class__.__name__))

    return arg
541258
def to_datetime(date):
    
    return datetime.datetime.combine(date, datetime.datetime.min.time())
905140
public static function dateTimeToTimeStamp($datetime)
    {
        $year   = substr($datetime,0,4);
        $month  = substr($datetime,5,2);
        $day    = substr($datetime,8,2);
        $hour   = substr($datetime,11,2);
        $minute = substr($datetime,14,2);
        $second = substr($datetime,17,2);

        date_default_timezone_set("Europe/Berlin");
        $string = mktime($hour, $minute, $second, $month, $day, $year);

        return $string;
    }
1348828
public static Timestamp toTimestamp(final Date date)
	{
		final Calendar cal = new GregorianCalendar();
		cal.setTime(date);
		cal.set(Calendar.HOUR_OF_DAY, 0);
		cal.set(Calendar.MINUTE, 0);
		cal.set(Calendar.SECOND, 0);
		cal.set(Calendar.MILLISECOND, 0);

		return new Timestamp(cal.getTime().getTime());
	}
384222
public static java.sql.Timestamp toTimestamp(String date, String time) {
		java.util.Date newDate = toDate(date, time);

		if (newDate != null)
			return new java.sql.Timestamp(newDate.getTime());
		else
			return null;
	}
644112
def timestamp_to_datetime(timestamp):
    """"""
    from datetime import datetime, timedelta
    obj = datetime.fromtimestamp(timestamp[0])
    return obj + timedelta(microseconds=int(timestamp[1]))
283527
public static Date stringToCustomDateTime(SimpleDateFormat sdf, String datetime) throws ParseException {
        return sdf.parse(datetime.trim());
    }
1161778
public static java.util.Date toDate(String dateTime) {
		// dateTime must have one space between the date and time...
		String date = dateTime.substring(0, dateTime.indexOf(" "));
		String time = dateTime.substring(dateTime.indexOf(" ") + 1);

		return toDate(date, time);
	}
609577
public static String formatDateUTC(Date time) {
        // Map date/time to a GregorianCalendar object (GMT time zone).
        GregorianCalendar date = new GregorianCalendar(UTC_TIMEZONE);
        date.setTimeInMillis(time.getTime());
        return formatDate(date);
    }
411285
public static Time convertDateToTime(Date date, Time elseValue) {
        return Checker.isNull(date) ? elseValue : new Time(date.getTime());
    }
1300624
private function _processDateTime($dateTime)
    {
        if (is_numeric($dateTime)) {
            $timestamp = $dateTime;
            $dateTime = new \DateTime();
            $dateTime->setTimestamp($timestamp);
        } elseif (empty($dateTime)) {
            throw new \InvalidArgumentException('Date/time is empty');
        } elseif (is_string($dateTime)) {
            $dateTime = new \DateTime($dateTime);
        }

        if (!($dateTime instanceof \DateTime)) {
            throw new \InvalidArgumentException('Incorrect date/time type');
        }
        return $dateTime;
    }
624544
public static TimestampString jodaToCalciteTimestampString(final DateTime dateTime, final DateTimeZone timeZone)
  {
    // The replaceAll is because Calcite doesn't like trailing zeroes in its fractional seconds part.
    String timestampString = TRAILING_ZEROS
        .matcher(CALCITE_TIMESTAMP_PRINTER.print(dateTime.withZone(timeZone)))
        .replaceAll("");
    return new TimestampString(timestampString);
  }
117545
public static Timestamp toTimestamp(DateTime dt) {
        if (dt == null) {
            return null;
        } else {
            return new Timestamp(dt.getMillis());
        }
    }
247039
def convert_timestamp(timestamp):
    
    datetime = dt.datetime.utcfromtimestamp(timestamp/1000.)
    return np.datetime64(datetime.replace(tzinfo=None))