# TIME

> TIME function in StackQL: return a time as an HH:MM:SS string from a time value and optional modifiers.

Source: https://stackql.io/language-spec/functions/datetime/time

Returns a time string in the format HH:MM:SS.  

See also:  
[[` SELECT `]](/language-spec/select) [[ Date Modifiers ]](/language-spec/functions/datetime/date_modifiers) 

* * * 

## Syntax

```sql
SELECT TIME(datetime_expression [, modifier, ...]) FROM <multipartIdentifier>;
```

## Arguments

__*datetime_expression*__  
The datetime value.

__*modifier*__  
Zero or more modifiers to be applied to the *datetime_expression*.  For more information about modifiers, see [**Date Modifiers**](/language-spec/functions/datetime/date_modifiers)

## Return Value(s)

Returns a string representing the time component of the input *datetime_expression* with the *modifier* applied.

* * *

## Examples

### Return the time component of a datetime value

```sql
SELECT name, timeCreated,
time(timeCreated) as time_only
FROM google.storage.buckets WHERE project = 'stackql';
```

### Return the local time component of a datetime value

```sql
SELECT name, timeCreated,
time(timeCreated, 'localtime') as local_time
FROM google.storage.buckets WHERE project = 'stackql';
```

For more information, see [https://www.sqlite.org/lang_datefunc.html](https://www.sqlite.org/lang_datefunc.html)
