diff options
Diffstat (limited to 'indra/newview/lldateutil.h')
-rw-r--r-- | indra/newview/lldateutil.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index 041be07f12..a0df21022e 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -36,6 +36,29 @@ class LLDate; namespace LLDateUtil { + /** + * Convert a date provided by the server into seconds since the Epoch. + * + * @param[out] date Number of seconds since 01/01/1970 UTC. + * @param[in] str Date string (MM/DD/YYYY) in PDT time zone. + * + * @return true on success, false on parse error + */ + bool dateFromPDTString(LLDate& date, const std::string& str); + + /** + * Get human-readable avatar age. + * + * Used for avatar inspectors and profiles. + * + * @param born_date Date an avatar was born on. + * @param now Current date. + * + * @return human-readable localized string like "1 year, 2 months", + * or "???" on error. + */ + std::string ageFromDate(const LLDate& born_date, const LLDate& now); + // Convert a date provided by the server (MM/DD/YYYY) into a localized, // human-readable age (1 year, 2 months) using translation strings. // Pass LLDate::now() for now. |