Date conversion

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Date conversion

Felipe Carrillo
Hi:
Can't find a way to convert from shortDate to LongDate format. I got:
3/10/10 that I want to convert to March 10, 2010. I am using:

\documentclass[11pt]{article}
\usepackage{longtable,verbatim}
\usepackage{ctable}
\usepackage{datetime}
\title{my title}
\begin{document}
  % Convert date
\mmmmddyyyydate\3/10/10
end{document} 

My report is changing every two weeks so I will eventually
use \Sexpr{report[1,1]} to grab the date from column 1, row 1
of a table named "report" but right now my report has the date
formated as described above (3/10/10).

 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA




______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Date conversion

Joshua Wiley-2
Hello Felipe,

Is this what you want?

format(as.Date("3/10/10", format="%m/%d/%y"), "%B %d, %Y")

Josh

On Thu, Jun 10, 2010 at 8:29 AM, Felipe Carrillo
<[hidden email]> wrote:

> Hi:
> Can't find a way to convert from shortDate to LongDate format. I got:
> 3/10/10 that I want to convert to March 10, 2010. I am using:
>
> \documentclass[11pt]{article}
> \usepackage{longtable,verbatim}
> \usepackage{ctable}
> \usepackage{datetime}
> \title{my title}
> \begin{document}
>   % Convert date
> \mmmmddyyyydate\3/10/10
> end{document}
>
> My report is changing every two weeks so I will eventually
> use \Sexpr{report[1,1]} to grab the date from column 1, row 1
> of a table named "report" but right now my report has the date
> formated as described above (3/10/10).
>
>
> Felipe D. Carrillo
> Supervisory Fishery Biologist
> Department of the Interior
> US Fish & Wildlife Service
> California, USA
>
>
>
>
> ______________________________________________
> [hidden email] 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.
>



--
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/

______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: Date conversion

Felipe Carrillo
Thanks Joshua, I wanted to use some kind of date format in latex
but ended up using exactly what you and Marc suggested.
 
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA



----- Original Message ----
> From: Joshua Wiley <[hidden email]>
> To: Felipe Carrillo <[hidden email]>
> Cc: [hidden email]
> Sent: Thu, June 10, 2010 1:18:27 PM
> Subject: Re: [R] Date conversion
>
> Hello Felipe,

Is this what you want?

format(as.Date("3/10/10",
> format="%m/%d/%y"), "%B %d, %Y")

Josh

On Thu, Jun 10, 2010 at 8:29
> AM, Felipe Carrillo
<> href="mailto:[hidden email]">[hidden email]>

> wrote:
> Hi:
> Can't find a way to convert from shortDate to
> LongDate format. I got:
> 3/10/10 that I want to convert to March 10,
> 2010. I am using:
>
> \documentclass[11pt]{article}
>
> \usepackage{longtable,verbatim}
> \usepackage{ctable}
>
> \usepackage{datetime}
> \title{my title}
> \begin{document}
>
>   % Convert date
> \mmmmddyyyydate\3/10/10
>
> end{document}
>
> My report is changing every two weeks so I will
> eventually
> use \Sexpr{report[1,1]} to grab the date from column 1, row
> 1
> of a table named "report" but right now my report has the date
>
> formated as described above (3/10/10).
>
>
> Felipe D.
> Carrillo
> Supervisory Fishery Biologist
> Department of the
> Interior
> US Fish & Wildlife Service
> California,
> USA
>
>
>
>
>
> ______________________________________________
> > ymailto="mailto:[hidden email]"
> href="mailto:[hidden email]">[hidden email] 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.
>



--
>
Joshua Wiley
Senior in Psychology
University of California,
> Riverside
http://www.joshuawiley.com/




______________________________________________
[hidden email] 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.