The following operations are supported. For a formal definition, please review the Service Description.

Web Service Links

Namespace Children of ::datetime

Namespace Code for ::datetime

namespace eval ::datetime {
    variable bindMap {https://highfivediet.com/datetime/CheckDateTimeOperation CheckDateTimeOperation https://highfivediet.com/datetime/ShowDateTimeComponentsOperation ShowDateTimeComponentsOperation https://highfivediet.com/datetime/AddDurationToDateTimeOperation AddDurationToDateTimeOperation https://highfivediet.com/datetime/DayNameFromNumberOperation DayNameFromNumberOperation}
    variable binding soap::documentLiteral
    variable bindingName datetimeSoapBind
    variable documentLinks {config ::datetime simpleTypes ::wsdb::types::datetime complexTypes ::wsdb::elements::datetime messages ::wsdb::messages::datetime operations ::wsdb::operations::datetime portTypes ::wsdb::portTypes::datetime port ::wsdb::ports::datetimePort binding ::wsdb::bindings::datetimeSoapBind service ::wsdb::services::datetimeService server ::wsdb::servers::datetimeServer}

    variable elements
         set elements(AddDurationToDateTimeRequest) {{

    {StartDateTime!dateTime}
    {Duration!duration}
} {StartDateTime Duration}}
         set elements(CheckDateTimeRequest) {{

    {DateTime!dateTime}
} DateTime}
         set elements(DayNameFromNumberRequest) {{
    {DayNumber!datetime::dayNumber}
} DayNumber}
         set elements(ShowDateTimeComponentsRequest) {{

    {DateTime}
} DateTime}
         set elements(AddDurationToDateTimeResponse) {{StartDateTime!dateTime Duration!duration EndDateTime!dateTime} {StartDateTime Duration EndDateTime}}
         set elements(CheckDateTimeResponse) {{DateTime!dateTime IsDateTime!boolean} {DateTime IsDateTime}}
         set elements(DayNameFromNumberResponse) {DayName!datetime::dayName DayName}
         set elements(ShowDateTimeComponentsResponse) {{
    TestString 
    IsDateTime!boolean
    {All {minOccurs 0}}
    {YMD!dateTime {minOccurs 0}}
    {Year!gYear {minOccurs 0}}
    {Positivity!minusOptional {minOccurs 0}}
    {Month!gMonth {minOccurs 0}}
    {Day!gDay {minOccurs 0}}
    {HMS {minOccurs 0}}
    {Hour {minOccurs 0}}
    {Minute {minOccurs 0}}
    {Second {minOccurs 0}}
    {SecondWhole {minOccurs 0}}
    {SecondFract {minOccurs 0}}
    {Timezone {minOccurs 0}}
    {TZSign {minOccurs 0}}
    {TZValue {minOccurs 0}}
    {TZ14Hour {minOccurs 0}}
    {TZ14Min {minOccurs 0}}
    {TZHour {minOccurs 0}}
    {TZMin {minOccurs 0}}
} {TestString IsDateTime All YMD Year Positivity Month Day HMS Hour Minute Second SecondWhole SecondFract Timezone TZSign TZValue TZ14Hour TZ14Min TZHour TZMin}}
    variable frozen 0
    variable host highfivediet.com
    variable hostHeader highfivediet.com
    variable hostHeaderList highfivediet.com
    variable operation DayNameFromNumberOperation
    variable operations {CheckDateTimeOperation ShowDateTimeComponentsOperation AddDurationToDateTimeOperation DayNameFromNumberOperation}
    variable port 80
    variable portName datetimePort
    variable portType datetimePortType
    variable protocol https
    variable schemaIsInitialized 1
    variable serverName datetimeServer
    variable serviceName datetimeService
    variable showDocument 1
    variable soapActionBase https://highfivediet.com/datetime
    variable targetNamespace urn:tcl:datetime
    variable tclNamespace ::datetime

    variable types
         set types(gYear) {base xsd::string pattern {\A(-)?([0-9]{4}|[1-9]{1}[0-9]{4,})(Z|(([\+\-]{1}))?((?:(14)(?::)(00))|(?:([0][0-9]|[1][0-3])(?::)([0-5][0-9]))))?\Z}}
         set types(word) {base xsd::string pattern {[^[:space:]]}}
         set types(gDay) {base xsd::string pattern {\A([0][0-9]|[12][0-9]|[3][01])(Z|(([\+\-]{1}))?((?:(14)(?::)(00))|(?:([0][0-9]|[1][0-3])(?::)([0-5][0-9]))))?\Z}}
         set types(gMonth) {base xsd::string pattern {\A(?:([0][1-9]|[1][0-2]))(Z|(([\+\-]{1}))?((?:(14)(?::)(00))|(?:([0][0-9]|[1][0-3])(?::)([0-5][0-9]))))?\Z}}
         set types(year) {base xsd::integer pattern {\A(-)?([0-9]{4}|[1-9]{1}[0-9]{4,})\Z}}
         set types(gYearMonth) {base xsd::string pattern {\A(-)?([0-9]{4}|[1-9]{1}[0-9]{4,})(?:-)(?:([0][1-9]|[1][0-2]))\Z}}
         set types(minusOptional) {base xsd::string pattern {\A(-)?\Z}}
         set types(gMonthDay) {base xsd::string pattern {\A(?:([0][1-9]|[1][0-2]))(?:-)([0][0-9]|[12][0-9]|[3][01])\Z}}
         set types(timeZone) {base xsd::string pattern {\A(Z|(([\+\-]{1}))?((?:(14)(?::)(00))|(?:([0][0-9]|[1][0-3])(?::)([0-5][0-9]))))?\Z}}
         set types(dayNumber) {base xsd::integer enum {0 1 2 3 4 5 6}}
         set types(dayName) {base datetime::word enum {Monday Tuesday
    Wednesday Thursday Friday Saturday Sunday}}
    variable url /twist/datetime/
    variable xmlPrefix datetime

}

Procedures in ::datetime


proc ::datetime::DayNameFromNumber {
    DayNumber
} {
    return [lindex {
    Monday Tuesday
    Wednesday Thursday Friday
    Saturday Sunday} $DayNumber]
}


proc ::datetime::ShowDateTimeComponents {
    DateTime
} {
    set IsDateTime [::wsdb::types::tcl::dateTime::toArray $DateTime DT]
    ::tws::log::log Notice "ShowDateTimeComponents DT=[array get DT]"
    if {!$IsDateTime} {
        return [list $DateTime False]
    } else {
        return [list $DateTime True $DT(all) $DT(YMD) $DT(year)  $DT(Positivity) $DT(month) $DT(day) $DT(HMS) $DT(hour) $DT(minute) $DT(second) $DT(SecondWhole) $DT(SecondFract) $DT(Timezone) $DT(TZSign)  $DT(TZValue)  $DT(TZ14Hour) $DT(TZ14Min) $DT(TZHour) $DT(TZMin)]
    }

}


proc ::datetime::AddDurationToDateTime {
    StartDateTime
    Duration
} {

    set dateValid [::wsdb::types::tcl::dateTime::toArray $StartDateTime inDateArray]
    set durationValid [::wsdb::types::tcl::dateTime::durationToArray $Duration durationArray]
    array set tmpDurationArray [array get durationArray]

    foreach {element value} {year 0 month 0 day 0 hour 0 minute 0 second 0} {

        if {"$durationArray($element)" eq ""} {
            set tmpDurationArray($element) "$value"
        }
    }
    
    ::wsdb::types::tcl::dateTime::addDuration inDateArray tmpDurationArray outDateArray

    ::tws::log::log Notice "AddDurationToDateTime: Finished adding duration, formatting"

    set outDate [::wsdb::types::tcl::dateTime::formatDateTime outDateArray]

    return [list $StartDateTime $Duration $outDate]

}


proc ::datetime::CheckDateTime {
    DateTime
} {

    return [list $DateTime True]

}