- Overview
- Data types
- Commands
- Functions
- Overview
- Aggregate
- Conditional expression
- Conversion
- Date and time
- Numeric
- String
- Semi-structured data
- Window
- System
On this page
strftime, strptime
Formats timestamps as strings and parses strings as timestamps.
Syntax
strftime( <timestamp_expr>, format => <format> [, timezone => <timezone> ] )
strptime( <string_expr>, format => <format> )
Arguments
format uses strftime-style formatting.
timezone is optional for strftime. The default is UTC.
When strptime parses a value without an offset or time zone, ScopeDB treats it as UTC.
Returns
strftime returns string.
strptime returns timestamp.
Examples
SELECT strftime(now(), format => '%Y-%m-%d %H:%M:%S', timezone => 'UTC');
SELECT strptime('2026-05-04 12:30:00', format => '%Y-%m-%d %H:%M:%S');