This site Web
Home Page | The Sun API | Gallery | InfoSearch | News | Links | Contact Us

Sunlit Design > The Sun API > Documentation > sdxTime2Text Function


Index


- Introduction
+ Using the Functions
+ User Guide
+ Function Reference
+ Constants

Contact Developer

Downloads

sdxTime2Text Function

Description

Returns a string representation of a time value for printing.

Syntax

sdxTime2Text(timex)

timex   

A String; Modified Julian Day (MJD),  Solar Day of Year (SDY), Universal Time Day (UTD) or Clock Time Day (CTD) time value.

Time Value Formats

MJD Time Value

"<MJD> nnn </MJD>"
"<MJD> nnn </MJD><TimeZone> tz </TimeZone>"

See sdMJDx function.
SDY Time Value

"<SDY> nnn </SDY>"
"<SDY> nnn </SDY><TimeZone> tz </TimeZone>"

See sdSDYx function.
UTD Time Value

"<UTD> nnn </UTD>"
"<UTD> nnn </UTD><TimeZone> tz </TimeZone>"

See sdUTDx function.
CTD Time Value

"<CTD> nnn </CTD>"

See sdCTDx function.

All MJD, SDY, and UTD values are expressed in UT. A <TimeZone> appended to the time value is used, where present, to convert this time back to it's original timezone. 

The sdMJDx, sdSDYx, sdUTDx, and sdCTDx functions may be used to create time values usable by this function.

Return Values

This function returns a string.

If timex is a

MJD time value     For positive years: 
" yyyy/mm/dd hh:mm:ss.ssss [tz gives UT]" 
(Note the leading space)

For negative years: 
"-yyyy/mm/dd hh:mm:ss.ssss [tz gives UT]"

SDY time value "mm/dd hh:mm:ss.ssss [tz gives UT]" 
UTD time value "hh:mm:ss.ssss  [tz gives UT]" 
CTD time value "hh:mm:ss.ssss" 

Accuracy

sdxTime2Text returns a second to 4 decimal places.

Remarks

Example

What is the printable string for the MJD value 56783.672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxtime2text("<MJD>56783.672</MJD><TimeZone>-7</TimeZone>") 
gives 
    " 2014/05/06 23:07:40.8000 [-7 gives UT]" (i.e. May 6th 2014, 11:07:40.8 pm 7 hours east of Greenwich)

What is the printable string for the SDY value 83.672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxtime2text("<SDY>83.672</SDY><TimeZone>-7</TimeZone>") 
gives 
    "03/24 23:07:40.8000 [-7 gives UT]" (i.e. March 23th, 11:07:40.8 pm 7 hours east of Greenwich)

What is the printable string for the UTD value 0.672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxtime2text("<UTD>.672</UTD><TimeZone>-7</TimeZone>") 
gives 
    "23:07:40.8000 [-7 gives UT]" (i.e. 11:07:40.8 pm 7 hours east of Greenwich)

What is the printable string for the CTD value 0.672:

    sdxtime2text("<CTD>.672</CTD>") 
gives 
    "16:07:40.8000" (i.e. 4:07:40.8 pm )