Products · Templates
get_server_time
Get the current time as a page value, for example to show on a receipt screen.
The get_server_time template gets the current time and stores it as the page value. Use it when you want to show the subscriber when something happened.
Configuration
This template takes no template_data and shows nothing on screen, so label isn't needed:
{
"id": "fetch_time",
"component": {
"type": "template",
"template_name": "get_server_time"
}
}What It Returns
The page value is the current time in UTC, for example Fri, 30 Oct 2026 14:32:10 GMT. Read it with $(page.PAGE_ID.value).
To use the time inside an expression, for example to get the hour, use datetime.now() or datetime.extract(...) instead. See Expressions.
Example: Time on a Receipt Screen
{
"version": "1.0",
"pages": [
{
"id": "make_payment",
"component": {
"type": "template",
"label": "Enter your $(session.network_provider_name) PIN to pay {{amount}} for your Lumley Power top-up.",
"template_name": "collect_payment",
"template_data": {
"payment_target_ref": "7150001234",
"amount": 50
}
}
},
{
"id": "get_time",
"component": {
"type": "template",
"template_name": "get_server_time"
}
},
{
"id": "receipt",
"component": {
"type": "display",
"label": "Paid SLE 50.\nRef: $(page.make_payment.value)\nTime: $(page.get_time.value)"
}
}
]
}Keep reading
get_provider_kyc_nameGet the name the subscriber's account is registered under with their network.TemplatesBuilt-in steps for payments, the subscriber's name and number, and the server time.collect_paymentTake a mobile money payment during a USSD session. The subscriber approves it with their PIN.get_subscriber_msisdnAsk the subscriber for permission to use their phone number, then save it or send it to your server.