Skip to content
Prev 359998 / 398503 Next

Query about use of format in strptime

On Mon, 11 Apr 2016, Stefano Sofia <stefano.sofia at regione.marche.it> writes:
strptime creates a POSIXlt object, and the specified format
tells it how to interpret the string you pass in. (Your
factor is converted to character by strptime.)

If you want to have the POSIXlt object printed in a
particular way, use ?strftime or ?format.

  > format(strptime(init_day, format="%Y-%m-%d-%H-%M"), "%Y-%m-%d-%H-%M")
  ## [1] "2015-02-24-00-00"
Message-ID: <878u0k60le.fsf@enricoschumann.net>
In-Reply-To: <8B435C9568170B469AE31E8891E8CC4F3DBA7224@ESINO.regionemarche.intra> (Stefano Sofia's message of "Mon, 11 Apr 2016 07:22:21 +0000")