stri_datetime_fstr: Convert 'strptime'-Style Format Strings

View source: R/time_format.R

stri_datetime_fstrR Documentation

Convert strptime-Style Format Strings


This function converts strptime or strftime-style format strings to ICU format strings that may be used in stri_datetime_parse and stri_datetime_format functions.


stri_datetime_fstr(x, ignore_special = TRUE)



character vector of date/time format strings


if FALSE, special identifiers like "datetime_full" or date_relative_short (see stri_datetime_format) are left as-is


For more details on conversion specifiers please refer to the manual page of strptime. Most of the formatters of the form %x, where x is a letter, are supported. Moreover, each %% is replaced with %.

Warnings are given in the case of %x, %X, %u, %w, %g, %G, %c, %U, and %W as in such circumstances either ICU does not support the functionality requested using the string format API or there are some inconsistencies between base R and ICU.


Returns a character vector.


Marek Gagolewski and other contributors

See Also

The official online manual of stringi at

Gagolewski M., stringi: Fast and portable character string processing in R, Journal of Statistical Software 103(2), 2022, 1-59, doi: 10.18637/jss.v103.i02

Other datetime: stri_datetime_add(), stri_datetime_create(), stri_datetime_fields(), stri_datetime_format(), stri_datetime_now(), stri_datetime_symbols(), stri_timezone_get(), stri_timezone_info(), stri_timezone_list()


stri_datetime_fstr('%Y-%m-%d %H:%M:%S')

stringi documentation built on Jan. 11, 2023, 5:18 p.m.