Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.
Moderators: chulett , rschirm , roy
venkycool
Participant
Posts: 59 Joined: Fri Feb 16, 2007 12:24 am
Location: USA
Post
by venkycool » Mon Jul 14, 2008 10:19 am
Hi all,
Can anyone let me know the windows command for current time which should show only the HOUR.
for eg: In Unix, the command is date +%H which shows the result as 11 (24 hour format) if the current time is 11:20:36.
I need the same command the get it worked in Windows.
Thanks in advance.
Suriv
No one is perfect... that's why pencils have erasers
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Jul 14, 2008 10:58 am
For an actual DOS command, all I am aware of is time /t and then you'd need to parse out the hour. If we're talking PX with the MKSToolkit then the UNIX commands can be used.
-craig
"You can never have too many knives" -- Logan Nine Fingers
sachin1
Participant
Posts: 325 Joined: Wed May 30, 2007 7:42 am
Location: india
Post
by sachin1 » Mon Jul 14, 2008 11:05 am
echo %time:~0,2%
C:\Documents and Settings\s1>echo %time%
22:32:38.65
for above time in 24 hour format, below commad gives the output as 22
C:\Documents and Settings\sabankar>echo %time:~0,2%
22
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Jul 14, 2008 11:09 am
Well, that's certainly intuitive.
-craig
"You can never have too many knives" -- Logan Nine Fingers
venkycool
Participant
Posts: 59 Joined: Fri Feb 16, 2007 12:24 am
Location: USA
Post
by venkycool » Mon Jul 14, 2008 12:43 pm
Thanks alot Sachin,
I was using time /t command only. I just had a thought whether we can have only HOUR....You got it for me...
Thanks all....
Suriv
No one is perfect... that's why pencils have erasers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Mon Jul 14, 2008 3:39 pm
chulett wrote: Well, that's certainly intuitive.
That's why they're called BAT files.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.