datestr2num {clim.pact} | R Documentation

## datestr2num

### Description

Converts a date string to number.

### Usage

    datestr2num(datestr,vec=TRUE)

### Arguments

`datestr` | A date string (character). Types of stings may be "01-Jan-1980","1-1-1980", "01-01-1980", "1980-1-1", "1980-Jan-1"
`vec` | TRUE returns a vector `c(year,month,day)`; FALSE returns `year + month/12 + day/31`.

### Value

A number or a vector

### Author(s)

R.E. Benestad

### Examples

    datestr2num("01-Jan-1980")
    datestr2num("1-1-1980")
    datestr2num("01-01-1980")
    datestr2num("1980-1-1")
    datestr2num("1980-Jan-1")

[Package Contents]