s2dhms

From DavinciWiki
Jump to: navigation, search

Description

Converts decimal seconds to days, hours, minutes, and seconds

Arguments and Return Values

Parameters: One scalar input specifying a number of seconds to convert

Return Value: A 4x1x1 array whose elements give the equivalent days, hours, minutes, and seconds, respectively

Usage

Syntax: s2dhms(ds)

The input must be numeric and scalar.

Watch out for slight roundoff errors, especially if not using double-precision input.

When dd2dms() is entered without any arguments, it prints its description, as shown below.

Examples

dv> s2dhms()

Converts scalar decimal seconds to DHMS array
s2dhms(ds) returns [D, h, m, s]
Input must be scalar
S.Marshall 10-02-2009

0
dv> Mars.sol
88775.2440000000
dv> s2dhms(Mars.sol)
4x1x1 array of double, bsq format [32 bytes]
1.00000000000000        0.00000000000000        39.0000000000000        35.2440000000061
dv> Earth.yr
31556925.1000000
dv> s2dhms(Earth.yr)
4x1x1 array of double, bsq format [32 bytes]
365.000000000000        5.00000000000000        48.0000000000000        45.1000000014901

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Major Sub-Functions

Related Functions

Recent Library Changes

Created On: 11-18-2009
Modified On: 11-20-2009

Personal tools