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

Sunlit Design > The Sun API > Documentation > sdxTimeUnpackx Function


Index


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

Contact Developer

Downloads

sdxTimeUnpackx Function

Description

Returns the component parts of a time value in an XML string format. The component parts are year, month, day, hour, minute, second, and timezone.

Syntax

sdxTimeUnpackx(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     "<Year>y</Year> <Month>mon</Month> <Day>d</Day> <Hour>d</Hour> <TMin>min</TMin> <TSec>s</TSec> <TimeZone>tz</TimeZone>"
SDY time value "<Month>mon</Month> <Day>d</Day> <Hour>d</Hour> <TMin>min</TMin> <TSec>s</TSec> <TimeZone>tz</TimeZone>"
UTD time value "<Hour>d</Hour> <TMin>min</TMin> <TSec>s</TSec> <TimeZone>tz</TimeZone>"
CTD time value "<Hour>d</Hour> <TMin>min</TMin> <TSec>s</TSec>"

Accuracy

sdxTimeUnpackx returns a second of at most 5 decimal places.

Remarks

The value of individual components of the degree value may be extracted from the returned value using the sdxGetv function.

Example

What are the component parts of the MJD value 56783.672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxTimeUnpackx("<MJD>56783.672</MJD><TimeZone>-7</TimeZone>") 
gives 
    " <Year> 2014</Year><Month> 5</Month><Day> 6</Day><Hour> 23</Hour><TMin> 7</TMin><TSec> 40.8</TSec><TimeZone>-7</TimeZone>"

(i.e. May 6th 2014, 11:07:40.8 pm 7 hours east of Greenwich)

Individual components may be extracted as numeric values:
    a$ = sdxTimeUnpackx("<MJD>56783.672</MJD>
                                     <TimeZone>-7</TimeZone>")
    y = sdxGetv("Year",a$)          ' 2014    
    m = sdxGetv("Month",a$)         ' 5
    d = sdxGetv("Day",a$)           ' 6
    h = sdxGetv("Hour",a$)          ' 23 

    min = sdxGetv("TMin",a$)        ' 7 
    s = sdxGetv("TSec",a$)          ' 40.8 
    tz = sdxGetv("TimeZone",a$)     ' -7

What are the component parts of the SDY value 83.672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxTimeUnpackx("<SDY>83.672</SDY><TimeZone>-7</TimeZone>") 
gives 
    "<Month> 3</Month><Day> 24</Day><Hour> 23</Hour>
            <TMin>7</TMin><TSec> 40.8</TSec><TimeZone>-7</TimeZone>"

(i.e. March 24th, 11:07:40.8 pm 7 hours east of Greenwich)

Individual components may be extracted as numeric values:
    a$ = sdxTimeUnpackx("<SDY>83.672</SDY>
                                     <TimeZone>-7</TimeZone>")
    m = sdxGetv("Month",a$)         ' 3
    d = sdxGetv("Day",a$)           ' 24
    h = sdxGetv("Hour",a$)          ' 23 

    min = sdxGetv("TMin",a$)        ' 7 
    s = sdxGetv("TSec",a$)          ' 40.8 
    tz = sdxGetv("TimeZone",a$)      ' -7

What are the component parts of the UTD value .672 in Summer Time Almaty, Kazakhstan:
    Summer Time Almaty Kazakhstan is -7 gives UT. 

    sdxTimeUnpackx("<UTD>.672</UTD><TimeZone>-7</TimeZone>") 
gives 
    "<Hour> 23</Hour> <TMin> 7</TMin><TSec>40.8</TSec>
             <TimeZone>-7</TimeZone>"

(i.e. 11:07:40.8 pm 7 hours east of Greenwich)

Individual components may be extracted as numeric values:
    a$ = sdxTimeUnpackx("<UTD>.672</UTD>
                                     <TimeZone>-7</TimeZone>")
    h = sdxGetv("Hour",a$)          ' 23 

    min = sdxGetv("TMin",a$)        ' 7 
    s = sdxGetv("TSec",a$)          ' 40.8 
    tz = sdxGetv("TimeZone",a$)      ' -7

What are the component parts of the CTD value .672:

    sdxTimeUnpackx("<CTD>.672</CTD>") 
gives 
    "<Hour> 16</Hour> <TMin> 7</TMin><TSec> 40.8</TSec>"

(i.e. 4:07:40.8 pm )

Individual components may be extracted as numeric values:
    a$ = sdxTimeUnpackx("<CTD>.672</CTD>")
    h = sdxGetv("Hour",a$)          ' 16 

    min = sdxGetv("TMin",a$)        ' 7 
    s = sdxGetv("TSec",a$)          ' 40.8