TI-BASIC Wiki
Advertisement


:timeCnv(seconds)

timeCnv(, stands for time convert, will returns a list {days, hours, minutes, seconds} that is equivalent to the number of seconds entered as a parameter.

  • Seconds will not be larger than 60.
  • Minutes will not be larger than 60.
  • Hours will not be larger than 24.
  • Days can be any value.
  • All elements will be positive.

Location[]

Catalog

Example[]

:timeCnv(startTmr)→L1
:For(θ,1,3)
::L1(θ+1)→L1(θ)
:End
:3→dim(L1)

If someone had something against the getTime function, one could use this much longer sequence instead.

It uses the startTmr variable, the number of seconds since some date at midnight. It converts that into an array {days since epoch, current hour, current minute, current second}. Then the days amount is discarded by moving each element in the list up one and shortening the array. The result is {current hour, current minute, current second}, the same as getTime returns.

Advertisement