# getTime()

Saaster offers a ready-to-use function for each user's correct time zone.

{% hint style="info" %}
Saaster sets the current time zone to UTC 0 by default. The getTime() function then converts the user's time based on their input or IP. This function is only available with a customer session.
{% endhint %}

Please always save your times to the database **using the Lucee function now()** and NOT with the SQL function NOW().

The component contains (among others) the following two functions:

* utc2local
* local2utc

If you now want to display the user's date and time (now) anywhere in the world, use this function:

```cfscript
lsDateFormat(getTime.utc2local(utcDate=now()));
lsTimeFormat(getTime.utc2local(utcDate=now()));
```

If you now want to display the date and time from a db entry, use this function:

```cfscript
lsDateFormat(getTime.utc2local(utcDate=qTable.theDate));
lsTimeFormat(getTime.utc2local(utcDate=qTable.theDate));
```

**Reminder:** The date and time in the database is stored in UTC 0.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saaster.io/development/develop-with-saaster/global-functions/gettime.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
