Date format conversion

Everything about Control-M Server installation or setup.
Post Reply
Nancy

Date format conversion

Post by Nancy » 20 Mar 2009 1:06

Hi All,
There is a scenario where we need to send a date and time to BODI job with a format like 2009.03.20 16:10:10

I have written the following code and have achieved a format like 2009:03:20 16:10:10 .

%%YYYY %%$OYEAR
%%MM %%OMONTH
%%DD %%ODAY
%%HHMMSS %%TIME
%%HOUR %%SUBSTR %%HHMMSS 1 2
%%MIN %%SUBSTR %%HHMMSS 3 2
%%SEC %%SUBSTR %%HHMMSS 5 2
%%DATE_TIME %YYYY:%%MM:%%DD %%HOUR:%%MIN:%%SEC
%%PARM1 "%%DATE_TIME"

Can anybody tell me how to convert 2009:03:20 16:10:10 to 2009.03.20 16:10:10 format??

Regards,
Nancy

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 20 Mar 2009 1:58

hoho

were is the question

Yves31

Post by Yves31 » 20 Mar 2009 2:16

Hello Nancy,

Try %%PARM1 %%$OYEAR..%%OMONTH..%%ODAY. %%A:%%B:%%C

Regards

Yves31

User avatar
rahulsehgal
Nouveau
Nouveau
Posts: 148
Joined: 19 Mar 2009 12:00
Location: Delhi
Contact:

Post by rahulsehgal » 23 Mar 2009 6:37

Hi,

Use this :-

%%YYYY %%$OYEAR
%%MM %%OMONTH
%%DD %%ODAY
%%HHMMSS %%TIME
%%HOUR %%SUBSTR %%HHMMSS 1 2
%%MIN %%SUBSTR %%HHMMSS 3 2
%%SEC %%SUBSTR %%HHMMSS 5 2
%%DATE_TIME %YYYY.%%MM.%%DD %%HOUR:%%MIN:%%SEC
%%PARM1 %%DATE_TIME

Nancy

Post by Nancy » 23 Mar 2009 6:54

Hi,
I have tried with your code but it still takes the date in the same 2009:03:20 16:10:10 format.

Is there any escape character for . ?

Regards,
Nancy

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 23 Mar 2009 8:01

Hi,
try:

%%HH %%SUBSTR %%TIME 1 2
%%MM %%SUBSTR %%TIME 3 2
%%SS %%SUBSTR %%TIME 5 2
%%PARM1 %%$OYEAR:%%OMONTH:%%ODAY%%BLANK1.%%HH..%%MM..%%SS

result is : 2009:03:22 07.58.02
Best regards
Walty

User avatar
rahulsehgal
Nouveau
Nouveau
Posts: 148
Joined: 19 Mar 2009 12:00
Location: Delhi
Contact:

Post by rahulsehgal » 23 Mar 2009 10:07

%%DATE_TIME %YYYY..%%MM..%%DD %%HOUR:%%MIN:%%SEC


This should work as we need to use .. for selecting dot .

Post Reply