NAME

timestamp_to_tv - convert a timestamp value to a time vector

SYNOPSIS

package require Humelib
humelib::timestamp_to_tv ts

DESCRIPTION

This command is used to convert a time value formatted as a timestamp, "YYYY-MM-DD HH:MM:SS[.[u]+]" to a six element vector {years months days hours minutes seconds}. The timestamp can have arbitrary single characters separating the year, month, day, and hours, but the usual zero-padded numeric values must be supplied. If the conversion cannot be done, an empty result is returned.

The command is part of the Humelib package and can be imported from the namespace humelib.

EXAMPLE

package require Humelib
namespace import -force humelib::*
set v1 [timestamp_to_tv "2002-12-25 08:09:10"]
set v2 [timestamp_to_tv "2002/12/25T08:09:10.123456"]
if { $v1 != $v2 } { error "should be equal"}

AUTHOR

Hume Integration Software, www.hume.com

SEE ALSO

localtime  mktime 

KEYWORDS

time, timestamp