Turn a Timestamp into a string using the specified locale.
966551
public static String time2DateString(java.sql.Timestamp time, Locale locale) {
        DateFormat df = DateFormat.getDateInstance(dateStyle, locale);
        return df.format(time);
    }
454035
def convert_to_timestamp(time):
    """"""
    if time == -1:
        return None
    time = int(time*1000)
    hour = time//1000//3600
    minute = (time//1000//60) % 60
    second = (time//1000) % 60
    return str(hour).zfill(2)+":"+str(minute).zfill(2)+":"+str(second).zfill(2)
234852
def timestamp2date(tstamp):
    ""
    dt = datetime.fromtimestamp(tstamp)
    if not dt.hour+dt.minute+dt.second+dt.microsecond:
        return dt.date()
    else:
        return dt
1291964
def date_to_long_string(date, lang = lang)
      local_date_string(date, Localization::DATE_FMT_LONG[lang], lang)
    end
902358
function formatTime(lang, input) {
	var result = input;
	var matches;
	var localeTimeString;

	while ((matches = TIME_REGEX.exec(input)) != null) {

		var date = new Date(Date.parse(matches[1]));
		localeTimeString = date.toLocaleTimeString(lang,
			{
				hour: 'numeric',
				minute: '2-digit'
			});

		result = result.replace(matches[0], localeTimeString);
	};
	return result;
}
771477
def execute_cast_simple_literal_to_timestamp(op, data, type, **kwargs):
    """"""
    return pd.Timestamp(data, tz=type.timezone)
939372
def strptime(string, timezone=0):
    """"""
    year = int(string[0:4])
    month = int(string[5:7])
    day = int(string[8:10])
    hour = int(string[-5:-3])
    minute = int(string[-2:])
    ts = datetime.datetime(year, month, day) + \
        datetime.timedelta(hours=hour, minutes=minute) - \
        datetime.timedelta(hours=timezone)
    return ts
711351
public static String timeStampToString(final Timestamp timestamp, final String format) {
        return dateToString(new Date(timestamp.getTime()), format);
    }
744381
public static final Function<Float,String> toCurrencyStr(Locale locale) {
        return (Function<Float,String>)((Function)FnNumber.toCurrencyStr(locale));
    }
302026
public static final Function<Number,String> toCurrencyStr(Locale locale) {
        return new ToString(NumberFormatType.CURRENCY, locale);
    }
27574
def repr_timestamp(timestamp):
    """"""
    if timestamp is None:
        return 'None'
    dt = datetime_from_timestamp(timestamp)
    ret = "%d (%s)" % (timestamp,
                       dt.strftime('%Y-%m-%d %H:%M:%S.%f %Z'))
    return ret
942893
def parse_timestamp(timestamp):
    """"""
    dt = dateutil.parser.parse(timestamp)
    return dt.astimezone(dateutil.tz.tzutc())
877005
def get_timestamp(timezone_name, year, month, day, hour=0, minute=0):
    """"""
    tz = pytz.timezone(timezone_name)
    tz_datetime = tz.localize(datetime(year, month, day, hour, minute))
    timestamp = calendar.timegm(tz_datetime.utctimetuple())
    return timestamp
266050
def timestamp(self, timestamp):
        """"""
        if timestamp is None:
            self._timestamp = datetime.utcnow()
        elif isinstance(timestamp, datetime):
            self._timestamp = timestamp
        else:
            self._timestamp = datetime.strptime(timestamp, fmt)
393604
def localize(dt, tz):
    
    if not isinstance(tz, tzinfo):
        tz = pytz.timezone(tz)

    return tz.localize(dt)
762029
def to_localized_time(self, date, **kw):
        
        date = api.to_date(date, default=None)
        if date is None:
            return ""
        # default options
        options = {
            "long_format": True,
            "time_only": False,
            "context": self.context,
            "request": self.request,
            "domain": "senaite.core",
        }
        options.update(kw)
        return ulocalized_time(date, **options)
247039
def convert_timestamp(timestamp):
    
    datetime = dt.datetime.utcfromtimestamp(timestamp/1000.)
    return np.datetime64(datetime.replace(tzinfo=None))