Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— |
engine:procedures:mi_getcurrentdate [11.01.2016 ] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ===== mi_GetCurrentDate ===== | ||
+ | |||
+ | Gibt das aktuelle Datum und die aktuelle Uhrzeit der Datenbank zurück.\\ | ||
+ | |||
+ | |||
+ | |||
+ | Mögliche Werte für "DateAndTimeFormat" (die Beispiele beziehen sich auf den Zeitpunkt "15. April 2012, 17:41:20:857 Uhr) :\\ | ||
+ | |||
+ | "0" : Format mon dd yyyy hh:mi[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 5:41PM')\\ "1" : Format mm/dd/yy (Beispiel : '04/15/12')\\ "2" : Format yy.mm.dd (Beispiel : '12.04.15')\\ "3" : Format dd/mm/yy (Beispiel : '15/04/12')\\ "4" : Format dd.mm.yy (Beispiel : '15.04.12')\\ "5" : Format dd-mm-yy (Beispiel : '15-04-12')\\ "6" : Format dd mon yy (Beispiel : '15 Apr 12')\\ "7" : Format mon dd, yy (Beispiel : Apr 15, 12')\\ "8" : Format hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : '17:41:20')\\ "9" : Format mon dd yyyy hh:mi:ss:mis[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 5:41:20:857PM')\\ "10" : Format mm-dd-yy (Beispiel : '04-15-12')\\ "11" : Format yy/mm/dd (Beispiel : '12/04/15')\\ "12" : Format yymmdd (Beispiel : '120415')\\ "13" : Format yy/dd/mm (Beispiel : '12/15/04')\\ "14" : Format mm/yy/dd (Beispiel : '04/12/15')\\ "15" : Format dd/yy/mm (Beispiel : '15/12/04')\\ "16" : Format mon dd yyyy hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 17:41:20')\\ "17" : Format hh:mi[AP]M ("IncludeTime" wird nicht beachtet ! Beispiel : '5:41PM')\\ "18" : Format hh:mi ("IncludeTime" wird nicht beachtet ! Beispiel : '17:41')\\ "19" : Format hh:mi:ss:mis[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : '5:41:20:857PM')\\ "20" : Format hh:mi:ss:mis ("IncludeTime" wird nicht beachtet ! Beispiel : '17:41:20:857')\\ "21" : Format yy/mm/dd hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : '12/04/15 hh:mi:ss')\\ "22" : Format yy/mm/dd hh:mi[AP]M ("IncludeTime" wird nicht beachtet ! Beispiel : '12/04/15 5:41PM')\\ "23" : Format yyyy-mm-ddThh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : '2012-04-15T17:41:20')\\ "100" : Format mon dd yyyy hh:mi[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 5:41PM')\\ "101" : Format mm/dd/yyyy (Beispiel : '04/15/2012')\\ "102" : Format yyyy.mm.dd (Beispiel : '2012.04.15')\\ "103" : Format dd/mm/yyyy (Beispiel : '15/04/2012')\\ "104" : Format dd.mm.yyyy (Beispiel : '15.04.2012')\\ "105" : Format dd-mm-yyyy (Beispiel : '15-04-2012')\\ "106" : Format dd mon yyyy (Beispiel : '15 Apr 2012')"106" : Format dd mon yyyy (Beispiel : '15 Apr 2012')\\ "107" : Format mon dd, yyyy (Beispiel : 'Apr 15, 2012')\\ "108" : Format hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : '17:41:20')\\ "109" : Format mon dd yyyy hh:mi:ss:mis[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 5:41:20:857PM')\\ "110" : Format mm-dd-yyyy (Beispiel : '04-15-2012')\\ "111" : Format yyyy/mm/dd (Beispiel : '2012/04/15')\\ "112" : Format yyyymmdd (Beispiel : '20120415')\\ "113" : Format yyyy/dd/mm (Beispiel : '2012/15/04')\\ "114" : Format mm/yyyy/dd (Beispiel : '04/2012/15')\\ "115" : Format dd/yyyy/mm (Beispiel : '15/2012/04')\\ "116" : Format mon dd yyyy hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : 'Apr 15 2012 17:41:20')\\ "117" : Format yyyy/mm/dd hh:mi:ss ("IncludeTime" wird nicht beachtet ! Beispiel : '2012/04/15 17:41:20')\\ "118" : Format yyyy/mm/dd hh:mi[PA]M ("IncludeTime" wird nicht beachtet ! Beispiel : '2012/04/15 5:41PM')\\ | ||
+ | |||
+ | |||
+ | |||
+ | Mögliche Werte für "IncludeTime" (die Beispiele beziehen sich auf den Zeitpunkt "15. April 2012, 17:41:20:857 Uhr) :\\ | ||
+ | |||
+ | "0" : Es wird keine Uhrzeit (gesondert) ausgegeben, wenn diese nicht aufgrund des durch "DateAndTimeFormat" angegebenen Formats sowieso schon enthalten ist\\ "1" : Format hh:mi:ss (Beispiel : ' 17:41:20')\\ "2" : Format hh:mi:ss:mis (Beispiel : ' 17:41:20:857')\\ "3" : Format hh:mi (Beispiel ' 17:41')\\ "11" : Format hh:mi:ss[PA]M (Beispiel ' 5:41:20PM')\\ "12" : Format hh:mi:ss:mis[PA]M (Beispiel ' 5:41:20:857PM')\\ "13" : Format hh:mi[PA]M (Beispiel ' 5:41PM')\\ "21" : Wie "1", das Trennzeichen zwischen Datum und Uhrzeit ist aber 'T' (Beispiel : 'T17:41:20')\\ "22" : Wie "2", das Trennzeichen zwischen Datum und Uhrzeit ist aber 'T' (Beispiel : 'T17:41:20:857')\\ "23" : Wie "3", das Trennzeichen zwischen Datum und Uhrzeit ist aber 'T' (Beispiel : 'T17:41')\\ "31" : Format hhmiss - KEIN Trennzeichen also (s. "DateAndTimeFormat = 12") ! (Beispiel : '174120')\\ "32" : Format hhmissmis - KEIN Trennzeichen also (s. "DateAndTimeFormat = 12") ! (Beispiel : '174120857')\\ "33" : Format hhmi - KEIN Trennzeichen also (s. "DateAndTimeFormat = 12") ! (Beispiel : '1741')\\ | ||
+ | |HTTP-Method|GET | | ||
+ | |HTTP-Auth|Optional | | ||
+ | |Tags|{{tag>[mi Get Current Date]}}| | ||
+ | |Engine-Kategorie|miscellaneous | | ||
+ | |Engine-Typ|Daten-Ermittlung | | ||
+ | |Letzte Aktualisierung|7.0.4 (2014-03-19)| | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | |||
+ | ^Name ((Pflichtparameter sind unterstrichen)) ^Standard-Wert ^Beschreibung ((siehe [[webservice:engine_parameterconventions|Parameter-Konventionen engine/<Prozedur-Name>]])) ^SQL-Datentyp((siehe [[:webservice:engine_datatypes|Datentypen im Bereich "engine"]])) ^ab Version ^ | ||
+ | |DateAndTimeFormat|104 |Bestimmt die Ausgabe des Datums in der Rückgabespalte "CurrentDate_char" - mögliche Werte : s. Beschreibung\\ |tinyint|6.5.0| | ||
+ | |IncludeTime|1 |Wird je nach "DateAndTimeFormat" beachtet oder nicht ! Bestimmt die Ausgabe der Uhrzeit-Angabe im (Datums-)Wert der Rückgabespalte "CurrentDate_char" - mögliche Werte : s. Beschreibung.\\ |tinyint|6.5.0| | ||
+ | ==== Rückgabe ==== | ||
+ | |||
+ | === (parameterunabhängig) === | ||
+ | |||
+ | ^Spaltenname ^Beschreibung ^SQL-Datentyp((siehe [[:webservice:engine_datatypes|Datentypen im Bereich "engine"]])) ^ab Version ^ | ||
+ | |CurrentDate|Das aktuelle Datum\\ |datetime|6.5.0 | | ||
+ | |CurrentDate_char|Das aktuelle Datum der Datenbank als Zeichenkette im durch "DateAndTimeFormat" und "IncludeTime" angegebenen Format\\ |varchar(30)|6.5.0 | | ||
+ | |Timestamp|Timestamp (Anzahl Millisekunden, die seit dem 01.01.1970 vergangen sind), wobei die Vorkomma-Stellen die Anzahl Sekunden (seit dem 01.01.1970) darstellen und die Nachkommastellen die restlichen Millisekunden enthalten\\ |money|6.5.0 | | ||
+ | ==== Output-Parameter ==== | ||
+ | |||
+ | Die Prozedur hat keine Output-Parameter.==== Mögliche Return-Codes ==== | ||
+ | |||
+ | Die Prozedur hat keine Fehlercodes. | ||
+ | ==== XML-Schema ==== | ||
+ | |||
+ | Die Rückgabe erfolgt als XML-Dokument welches gegen das Schema [[http://resources.dstore.de/xsd/webservice_SmartGate/Response/EngineProcedure_v1_0.xsd|Response/EngineProcedure_v1_0.xsd]] validiert. | ||
+ | ==== Historie ==== | ||
+ | |||
+ | |7.0.4 |2014-03-19|Kleine Kosmetik-Korrektur : Bei einigen Code-Zeilen war am Ende ein CR-Zeichen, was wir entfernt haben\\ | | ||
+ | |6.5.0 |2012-09-17|Erstmalig in dieser Version erstellt\\ | | ||
+ | |||
+ | ==== Code-Snippets ==== | ||
+ | |||
+ | == Engine Playground == | ||
+ | Der folgende Link öffnet in einem separaten Fenster den Engine Playground der fest mit dem dbap-demo System verbunden ist: | ||
+ | * [[http://playground.dstore.de/index.php?proc=mi_GetCurrentDate|mi_GetCurrentDate im Engine Playground öffnen]] | ||
+ | == cURL == | ||
+ | Unformatierte Ausgabe: | ||
+ | <code bash> | ||
+ | curl -X GET 'http://<partner>-<project>.dstore.de/default/engine/mi_GetCurrentDate'</code>Mit xmllint ((I.d.R. auf Unix-artigen Systemen bereits installiert, Bestandteil der libxml2, siehe http://www.xmlsoft.org)) formatierte Ausgabe: | ||
+ | <code bash> | ||
+ | curl -X GET 'http://<partner>-<project>.dstore.de/default/engine/mi_GetCurrentDate' | xmllint --format -</code>== dStore_php == | ||
+ | <code php> | ||
+ | use dStore_php\WebService; | ||
+ | |||
+ | $service = new WebService\Service( WebService\Scheme::HTTP,'<partner>-<project>.dstore.de', 80); | ||
+ | |||
+ | $request = new WebService\Requests\Engine\Procedure\Request( | ||
+ | new WebService\Requests\AccessData('default'), | ||
+ | 'mi_GetCurrentDate', | ||
+ | array( | ||
+ | // 'DateAndTimeFormat' => 104, | ||
+ | // 'IncludeTime' => 1 | ||
+ | ) | ||
+ | ); | ||
+ | |||
+ | $service->execute($request); | ||
+ | |||
+ | $xml_result = $request->getResponse()->getBody()->toSimpleXmlDocument(); | ||
+ | $ResultSet = $xml_result->getRowsAsArray(); | ||
+ | |||
+ | </code> | ||
+ | == engine/execute == | ||
+ | XML zur Ausführung mit der Methode [[:webservice:engine:execute|engine/execute]], z.B. per | ||
+ | curl --header 'Content-Type: application/xml' -X POST 'http://<partner>-<kunde>.dstore.de/default/engine/execute' -d '<xml-daten>' | ||
+ | |||
+ | <code xml> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <ListOfBatches> | ||
+ | <Batch No="0"> | ||
+ | <Procedure Name="mi_GetCurrentDate"> | ||
+ | <Parameters> | ||
+ | <!-- <Parameter Name="DateAndTimeFormat">104</Parameter> --> | ||
+ | <!-- <Parameter Name="IncludeTime">1</Parameter> --> | ||
+ | </Parameters> | ||
+ | </Procedure> | ||
+ | </Batch> | ||
+ | </ListOfBatches></code> | ||