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://www.semitasker.com/datetime/CheckDateTimeOperation CheckDateTimeOperation https://www.semitasker.com/datetime/AddDurationToDateTimeOperation AddDurationToDateTimeOperation https://www.semitasker.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(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}
    variable frozen 1
    variable host www.semitasker.com
    variable hostHeader www.semitasker.com
    variable hostHeaderList www.semitasker.com
    variable operation DayNameFromNumberOperation
    variable operations {CheckDateTimeOperation 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://www.semitasker.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/ws/datetime/
    variable xmlPrefix datetime

}

Procedures in ::datetime


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


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]

}