NewDash Dots are hereMini apps in Dash, with payments built inLearn more

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:

JSON
{
  "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

JSON
{
  "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