Table of Contents

# $EPIC: strptime.txt,v 1.1 2009/06/14 20:54:44 zwhite Exp $

Synopsis:

$strptime(“<format>” <string>)

Technical:

Practical:

You should refer to your system's strftime man page (``man 3 strftime'') for exact details of what a strftime format looks like, because describing them is beyond the scope of a help file. =) But this function is very useful for converting timestamps in different formats into a unix timestamp.

The behavior of strptime in epic is highly dependent upon the strptime(3) implementation of the system it is running on. If you intend to use this function in portable scripts you should avoid the use of system-specific format strings.

On systems with a 32 bit time_t this function is only practical for describing dates between Fri Dec 13 20:45:52 1901 and Tue Jan 19 03:14:07 2038.

Returns:

The number of seconds since the epoch, which is typically 1970 Jan 1, 00:00 UTC.

Examples:

$strptime("%Y-%m-%d %T" 1985-10-26 01:24:00) might return "499137840"
$strptime("%a %b %d %T %Y" Sun Jun 14 18:27:10 2009) might return "1245004030"
$strptime("%Y-%m-%d" 1992-04-26) might return "-1"
$strptime("%H:%M:%S" 16:00:00) might return "-1"

History:

This function first appeared in epic5-0.3.6.