DAYS()

From Lianjapedia
Revision as of 08:37, 8 October 2019 by Yvonne.milne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to return the number of whole days in a period expressed in seconds

Syntax

DAYS(<expN>)

See Also

AMPM(), CDOW(), CMONTH(), CTOD(), CTOT(), DATE(), DATETIME(), DAY(), DMY(), DOW(), DTOA(), DTOC(), DTOM(), DTOS(), DTOT(), DTOV(), ELAPTIME(), EMPTY(), EPOCH(), GOMONTH(), HOUR(), HOURS(), ISLEAPYEAR(), LEAPYEARS(), LTOS(), MDY(), MINUTE(), MINUTES(), MONTH(), MTOD(), MTOS(), QUARTER(), SEC(), SECONDS(), SECS(), SET CENTURY, SET DATE, SET EPOCH, SET HOURS, SET MARK, SET SECONDS, STOD(), STOT(), STR(), STRFTIME(), TIME(), TIMEOFDAY(), TIMESTAMP(), TSTRING(), TTOC(), TTOD(), TYPE(), VAL(), VALIDTIME(), VTOD(), WEEK(), YEAR()

Description

The DAYS() function returns the number of whole days in a specified period expressed in seconds from the given <expN>. The DAYS() function will return a value of zero if <expN> is less than 43200 (12 hours). For values between 43200 and 129599 (35 hours, 59 minutes, 59 seconds), DAYS() will return 1. For values of 36 hours to 59 hours, 59 minutes, 59 seconds the DAYS() function will return 2. This pattern continues as the number of seconds gets larger. The TSTRING() function can be used to return the duration of any remaining portions of days.

Example

? days(300033)
         3
m_secs=357812
? "The period was "+alltrim(str(days(m->m_secs)))+;
  " days and "+tstring(m->m_secs) +" hours"
The period was 4 days and 03:23:32 hours