frappe.utils.data._get_time_zone ()
No docs
frappe.utils.data.add_days (date, days)
No docs
frappe.utils.data.add_months (date, months)
No docs
frappe.utils.data.add_to_date (date, years=0, months=0, days=0)
Adds days
to the given date
frappe.utils.data.add_years (date, years)
No docs
Convert to integer
frappe.utils.data.comma_and (some_list)
No docs
frappe.utils.data.comma_or (some_list)
No docs
frappe.utils.data.comma_sep (some_list, pattern)
No docs
frappe.utils.data.compare (val1, condition, val2)
No docs
frappe.utils.data.convert_utc_to_user_timezone (utc_timestamp)
No docs
No docs
frappe.utils.data.date_diff (string_ed_date, string_st_date)
No docs
frappe.utils.data.encode (obj, encoding=utf-8)
No docs
frappe.utils.data.escape_html (text)
No docs
frappe.utils.data.expand_relative_urls (html)
No docs
frappe.utils.data.filter_strip_join (some_list, sep)
given a list, filter None values, strip spaces and join
frappe.utils.data.flt (s, precision=None)
Convert to float (ignore commas)
frappe.utils.data.fmt_money (amount, precision=None, currency=None)
Convert to string with commas for thousands, millions etc
frappe.utils.data.format_datetime (datetime_string, format_string=None)
No docs
frappe.utils.data.format_time (txt)
No docs
frappe.utils.data.formatdate (string_date=None, format_string=None)
Convers the given string date to :data:user_format
ser format specified in defaults
Examples:
frappe.utils.data.get_datetime (datetime_str=None)
No docs
frappe.utils.data.get_datetime_str (datetime_obj)
No docs
frappe.utils.data.get_first_day (dt, d_years=0, d_months=0)
Returns the first day of the month for the date specified by date object
Also adds d_years
and d_months
if specified
frappe.utils.data.get_host_name ()
No docs
frappe.utils.data.get_last_day (dt)
Returns last day of the month using:
get_first_day(dt, 0, 1) + datetime.timedelta(-1)
frappe.utils.data.get_link_to_form (doctype, name, label=None)
No docs
frappe.utils.data.get_number_format_info (format)
No docs
frappe.utils.data.get_time (time_str)
No docs
frappe.utils.data.get_time_zone ()
No docs
frappe.utils.data.get_url (uri=None, full_address=False)
get app url from request
frappe.utils.data.get_url_to_form (doctype, name)
No docs
frappe.utils.data.get_url_to_list (doctype)
No docs
frappe.utils.data.get_user_format ()
No docs
frappe.utils.data.getdate (string_date=None)
Coverts string date (yyyy-mm-dd) to datetime.date object
frappe.utils.data.global_date_format (date)
returns date as 1 January 2012
frappe.utils.data.has_common (l1, l2)
Returns truthy value if there are common elements in lists l1 and l2
frappe.utils.data.in_words (integer, in_million=True)
Returns string in words for the given integer.
frappe.utils.data.is_html (text)
No docs
frappe.utils.data.money_in_words (number, main_currency=None, fraction_currency=None)
Returns string in words with currency and fraction currency.
return current datetime as yyyy-mm-dd hh:mm:ss
frappe.utils.data.now_datetime ()
No docs
return current date as yyyy-mm-dd
return current time in hh:mm
frappe.utils.data.parse_val (v)
Converts to simple datatypes from SQL query results
frappe.utils.data.pretty_date (iso_datetime)
Takes an ISO time and returns a string representing how long ago the date represents. Ported from PrettyDate by John Resig
frappe.utils.data.quote_urls (html)
No docs
frappe.utils.data.quoted (url)
No docs
frappe.utils.data.remainder (numerator, denominator, precision=2)
No docs
frappe.utils.data.round_based_on_smallest_currency_fraction (value, currency, precision=2)
No docs
frappe.utils.data.rounded (num, precision=0)
round method for round halfs to nearest even algorithm aka banker's rounding - compatible with python3
frappe.utils.data.scrub_urls (html)
No docs
frappe.utils.data.strip (val, chars=None)
No docs
frappe.utils.data.strip_html (text)
removes anything enclosed in and including <>
frappe.utils.data.time_diff (string_ed_date, string_st_date)
No docs
frappe.utils.data.time_diff_in_hours (string_ed_date, string_st_date)
No docs
frappe.utils.data.time_diff_in_seconds (string_ed_date, string_st_date)
No docs
frappe.utils.data.to_markdown (html)
No docs
frappe.utils.data.to_timedelta (time_str)
No docs
No docs
frappe.utils.data.unique (seq)
use this instead of list(set()) to preserve order of the original list. Thanks to Stackoverflow: http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order