Get Server Time (T101)
Synchronize your client application time with the Uganda Revenue Authority EFRIS server. This endpoint returns the current server timestamp and requires no authentication or encryption.
Endpoint Overview
| Property | Value |
|---|---|
| Interface Code | T101 |
| Request Encrypted | ❌ No |
| Response Encrypted | ❌ No |
| Request Body | null |
| Response Format | JSON |
- PHP
- JavaScript / TypeScript
- Python
try {
// Call T101: Get Server Time
$response = $client->getServerTime();
$currentTime = $response['data']['content']['currentTime']
?? $response['currentTime']
?? null;
if ($currentTime) {
echo "✅ Server Time: {$currentTime}\n";
// Format: dd/MM/yyyy HH:mm:ss
} else {
echo "⚠️ Could not parse server time\n";
}
} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "❌ API Error: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
}
try {
// Call T101: Get Server Time
const response = await client.getServerTime();
const content = response?.data?.content ?? response;
const currentTime = content?.currentTime;
if (currentTime) {
console.log(`✅ Server Time: ${currentTime}`);
// Format: dd/MM/yyyy HH:mm:ss
return currentTime;
} else {
console.warn('⚠️ Could not parse server time');
return null;
}
} catch (error: any) {
console.error(`❌ API Error: ${error.message}`);
if (error.returnCode) {
console.error(` Return Code: ${error.returnCode}`);
}
throw error;
}
try:
# Call T101: Get Server Time
response = client.get_server_time()
content = response.get("data", {}).get("content", response)
current_time = content.get("currentTime")
if current_time:
print(f"✅ Server Time: {current_time}")
# Format: dd/MM/yyyy HH:mm:ss
return current_time
else:
print("⚠️ Could not parse server time")
return None
except Exception as e:
print(f"❌ API Error: {e}")
if hasattr(e, 'return_code'):
print(f" Return Code: {e.return_code}")
raise
Response Structure
{
"data": {
"content": {
"currentTime": "19/02/2025 10:00:00"
}
},
"globalInfo": {
"interfaceCode": "T101",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}
Response Fields
| Field | Required | Type | Description |
|---|---|---|---|
currentTime | ✅ Yes | String | Current server time in dd/MM/yyyy HH:mm:ss format |
Return Codes
| Code | Message | Description |
|---|---|---|
00 | SUCCESS | Request processed successfully |
99 | Unknown error | Generic server error |
06 | The outer message is empty | Malformed request envelope |
07 | GlobalInfo content cannot be empty | Missing required globalInfo |
11 | InterfaceCode cannot be empty | Missing interfaceCode in request |
28 | Time difference > 10 minutes | Client time out of sync with server |
💡 Tip: Use this endpoint at application startup to validate time synchronization. A difference greater than 10 minutes may cause subsequent authenticated requests to fail.
Common Use Cases
-
Time Synchronization Check
Validate client clock accuracy before submitting time-sensitive invoices. -
Health Check / Ping
Verify EFRIS API connectivity without authentication overhead. -
Logging & Auditing
Timestamp local operations with authoritative server time for compliance. -
Retry Logic
Use server time to calculate accurate backoff intervals for failed requests.