Skip to contents

Returns the current system time formatted according to the provided format string.

Usage

now(format = "%Y-%m-%d %H:%M:%OS2")

Arguments

format

A string representing the desired time format. Default is "%Y-%m-%d %H:%M:%OS2".

Value

A string representing the current system time in the specified format.

Examples

now()            # e.g. "2024-06-12 16:09:32.41"
#> [1] "2025-09-23 06:47:07.49"
now("%H:%M:%S")  # e.g. "16:09:32"
#> [1] "06:47:07"