Skip to content

Commit

Permalink
added origin f_12_hour
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Rinker committed Aug 18, 2017
1 parent 872690c commit 83a3215
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/f_12_hour.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ f_12_hour.default <- function(x, format = '%I:%M %p', pad.char = '', ...){
f_12_hour.integer <- function(x, format = '%I:%M %p', pad.char = '', ...){


out <- format(as.POSIXct(paste0("2017-08-18 ", ifelse(nchar(x) == 1, '0', ''), x, ":00:00")), format=format)
out <- format(as.POSIXct(paste0("2017-08-18 ", ifelse(nchar(x) == 1, '0', ''), x, ":00:00"), origin = "1960-01-01"), format=format)

gsub('^0', pad.char, out)

Expand Down

0 comments on commit 83a3215

Please sign in to comment.