Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@DATECONV[]

May
572
4
@DATECONV currently converts from the default format to the specified format.

Shouldn't there be an input format specifier as well as an result form specifier? Without one, how would one convert, for example, from format 2 to format 5 on a system whose default is format 1?

Suppose I read a date as 01-02-03 from a file known to be in format 2, but I want in ISO weekday format (5). The correct result is 2003-W05-6, but trying this on a system with default format 1 produces 2003-W01-4.

Rex, please consider adding an optional third parameter to indicate the INPUT format, if different from the system's default.
 
@DATECONV currently converts from the default format to the specified format.

Shouldn't there be an input format specifier as well as an result form specifier? Without one, how would one convert, for example, from format 2 to format 5 on a system whose default is format 1?

Suppose I read a date as 01-02-03 from a file known to be in format 2, but I want in ISO weekday format (5). The correct result is 2003-W05-6, but trying this on a system with default format 1 produces 2003-W01-4.

Rex, please consider adding an optional third parameter to indicate the INPUT format, if different from the system's default.

Definitely NITV; I'll add it to the suggestion list for a future version.

@DATECONV assumes that the first argument is either an understandable format (i.e., ISO) or that it's in the default format. @DATECONV isn't intended to do random date conversions. Nobody's ever asked for that before -- do you have an actual need for it?
 
Definitely NITV; I'll add it to the suggestion list for a future version.

@DATECONV assumes that the first argument is either an understandable format (i.e., ISO) or that it's in the default format. @DATECONV isn't intended to do random date conversions. Nobody's ever asked for that before -- do you have an actual need for it?

Yes, my actual need is almost exactly what I described. Well, I guess, since I have a work-around, it's an actual use rather than an actual need. I have a file that has format 2 dates and I need to convert them to format 4 dates, and my system default is format 1.
(In my original example, I proposed format 5.) What I do now is
Code:
set outstring=%@makedate[%@date[%instring,2],4]

What I'd prefer is
set outstring=%@dateconv[%instring,2,4]

Thanks for adding to the wish list for v12.
 
rconn wrote:
|| Definitely NITV; I'll add it to the suggestion list for a future
|| version.
||
|| @DATECONV assumes that the first argument is either an
|| understandable format (i.e., ISO) or that it's in the default
|| format. @DATECONV isn't intended to do random date conversions.
|| Nobody's ever asked for that before -- do you have an actual need
|| for it?

I do - when my program reads a report prepared in a format chosen by another
program.

I actually would also like an environment function (I do have a UDF, but its
cumbersome and slow) to convert from AM/PM to 24-h format while retaining
24-h format the default.
--
Steve
 
Back
Top