diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-20 12:41:00 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-20 12:41:00 +0100 |
commit | f33fff7e15947859f9c89cd5297971a28205bca8 (patch) | |
tree | 4abe6618d6bc69432707f23369587190d1ef544d /indra/newview/lldateutil.h | |
parent | e275b7a658ee29ca4ce3dd77908ddd4c34749449 (diff) | |
parent | 5952fbca316ba1d1e4243bf5ebd6dc647e4957f4 (diff) |
slightly hairy merge from viewer-trunk
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. |