API Reference - system.datetime
        
           Required Privacy:
        
        
          
          
            
            
          
          
            Data &
          
          
            
          
          
            Location
          
          
        
      
      
      
         Operation:
        
      
      This API allows to work with head-unit date & time.
Note: This API allows to retrive raw date & time, settings.datetime takes timezone into account .
| Input Parameter | |||||
|---|---|---|---|---|---|
| No input params | 
| Output Data | ||||
|---|---|---|---|---|
| Data name | Description | Type | Unit/Values | Example | 
| dateTime | Current raw date and time according to ISO-8601: Complete date plus hours, minutes, seconds and a decimal fraction of a second  | 
    string  | 
    
    
        
        
        
            
        
        
     | 
    
        2020-01-22T10:59:10.537Z
     | 
    
    
Code Example
    
    
  1
2
3
4
5
6
7
8
9
10
11
12
13
webportal.get(
    /* api name */
    "system.datetime",
    /* parameters */
     null
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "GET", 
  "api": "system.datetime",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
// --- format of the `REPLY` message ---
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "system.datetime",
  "status": 200,
  "statusText": "OK", 
  "data": "2020-01-22T10:59:10.537Z"
}
false