TUdateConv TCL UTILITIES USER MANUAL TUdateConv
SYNOPSIS
Convert date from year/day to year/month/day or vice-versa
PACKAGE
TCLUTILS
NAME
TUdateConv
USAGE
YearDay {Month}
TUdateConv  FmT
INPUT DEFINITIONS
FmT - Inout/Output Format
-YDM : Input format is Year, Month Day and output format is Year and Day of Year
YD.N : Input format is Year and Day of Year and output format is Year, Month, Day where Month is an integer from 1 to 12.
YD.3 : Input format is Year and Day of Year and output format is Year, Month, Day where Month is a 3 character ascii string.
YD.S : Input format is Year and Day of Year and output format is Year, Month, Day where Month is a 3 or 4 character ascii string.
YD.L : Input format is Year and Day of Year and output format is Year, Month, Day where Month is a fully spelled out.
Year - Input Year
Day - Input day
Month - Input Month when input is Year, Day, Month converting to Year and Day of Year
RETURN DEFINITION
rV - Depending on what quantities are being returned, this is a list containing either the Year and Day of Year or the Year, Day, and Month respectively.
DESCRIPTION
TUdateConv converts between year and day and year, day, month or vice-versa. Month can be input in upper or lower case or a mixture there of. It must either be a full spelling of the might, a three letter appreviation. Sept for September is also accepted. Abbreviated months my be followed by an optional period (.) .
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
# CONVERT dates 

set A [TUdateConv YDM 1949 12 Dec] 
set B [TUdateConv YDM 1984 31 Mar.] 
set C [TUdateConv YD.N 2004 246] 
set D [TUdateConv YD.3 2004 246] 
set E [TUdateConv YD.S 2004 246] 
set F [TUdateConv YD.L 2004 246] 

# PRINT results

puts stderr "Dec 12, 1949 converts to [lindex $A 0] [lindex $A 1]"
puts stderr "Mar 31, 1984 converts to [lindex $B 0] [lindex $B 1]"
puts stderr "2004/246 converts to [lindex $C 2]/[lindex $C 1]/[lindex $C 0]"
puts stderr "2004/246 converts to [lindex $D 2] [lindex $D 1], [lindex $D 0]"
puts stderr "2004/246 converts to [lindex $E 2] [lindex $E 1], [lindex $E 0]"
puts stderr "2004/246 converts to [lindex $F 2] [lindex $F 1], [lindex $F 0]"

> Dec 12, 1949 converts to 1949 346
> Mar 31, 1984 converts to 1984 91
> 2004/246 converts to 9/2/2004
> 2004/246 converts to Sep 2, 2004
> 2004/246 converts to Sept 2, 2004
> 2004/246 converts to September 2, 2004

      
Apr 22, 2003