Re: Leading Zeroes in variables

#1
From: gadib
| i would like to create a variable that has the format yyyymmddhhmm.tgz
| I tried set fn=%_year%%_month%%_day%%_hour%%_minute%.tgz
|
| The variable resolves to 2011515917.tgz
| How do I get TCC/LE it to insert leading zeroes in the variables?


While you were already shown verbose solutions, the simplest is available
using the _DATETIME internal variable, which has the value of date and time
to the second:

%@right[-2,%_datetime].tgz

BTW, I tried to send this originally as a response to the original message,
but it was rejected by the Forum with the message "thread already closed".
What caused closing of the original thread closed?
--
HTH, Steve
 
Jan 19, 2011
581
10
Norman, OK
#3
From: gadib
| i would like to create a variable that has the format yyyymmddhhmm.tgz

%@right[-2,%_datetime].tgz
It should be %@left[-2,%_datetime].tgz

@right returns yymmddhhmmss
@left returns yyyymmddhhmm
 
#4
From: JohnQSmith
| Originally Posted by Steve Fabian
|| From: gadib
||| i would like to create a variable that has the format
||| yyyymmddhhmm.tgz
||
|| %@right[-2,%_datetime].tgz
|
| It should be %@left[-2,%_datetime].tgz
|
| @right returns yymmddhhmmss
| @left returns yyyymmddhhmm

You are correct, I goofed!
--
Steve