Try:

format(as.Date("05/07/2014", "%m/%d/%Y"), "%m")
#[1] "05"

#or
strptime("05/07/2014", "%m/%d/%Y")$mon+1
#[1] 5



A.K.


How to extract a Month from Date object?

almost 13 peoples visited my Question with out replying in New to R , i have 
task yaar



don't mind plz could you HELP ME

How to extract a Month from Date object?

as.month("05/07/2014", format = "%m")

tried wityh this

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to