Skip to contents

Formats "timeDate" objects as ISO conform character strings.

Usage

# S3 method for timeDate
format(x, format = "", tz = "", usetz = FALSE, ...)

Arguments

format

a character string describing the format.

tz

a timezone specification to be used for the conversion.

usetz

a logical.

x

an object of class "timeDate".

...

arguments passed to other methods.

Value

an ISO conforming formatted character string

See also

as.character

Examples

## timeCalendar -
   # Time Calendar 16:00
   tC = timeCalendar() + 16*3600
   tC
#> GMT
#>  [1] [2023-01-01 16:00:00] [2023-02-01 16:00:00] [2023-03-01 16:00:00]
#>  [4] [2023-04-01 16:00:00] [2023-05-01 16:00:00] [2023-06-01 16:00:00]
#>  [7] [2023-07-01 16:00:00] [2023-08-01 16:00:00] [2023-09-01 16:00:00]
#> [10] [2023-10-01 16:00:00] [2023-11-01 16:00:00] [2023-12-01 16:00:00]
   
## Format as ISO Character String: 
   format(tC)
#>  [1] "2023-01-01 16:00:00" "2023-02-01 16:00:00" "2023-03-01 16:00:00"
#>  [4] "2023-04-01 16:00:00" "2023-05-01 16:00:00" "2023-06-01 16:00:00"
#>  [7] "2023-07-01 16:00:00" "2023-08-01 16:00:00" "2023-09-01 16:00:00"
#> [10] "2023-10-01 16:00:00" "2023-11-01 16:00:00" "2023-12-01 16:00:00"