Dear Raghuram Devarakonda,

 looks like the core question is about how to get the system time and
date from a native OS, like Windows 2003.

 Java itself provide some rich and handy classes (since Java 5)
which helps to format the date and time output using a given pattern.

 The new SimpleDateFormat class comes with the java.text library.
Using Java in place of native OS calls results in better portability.  
To avoid ambiguity with similar Python or SQL classes, I use to
rename the Date class (see a sample code below):  
 
from java.util import Date as javaDate
from java.text import SimpleDateFormat
# defining date and time output pattern
formatter_date = SimpleDateFormat("dd/MM/yyyy")
formatter_time = SimpleDateFormat("HH:KK:ss")
mytoday = javaDate()
formattedtoday_date = formatter_date.format(mytoday)
formatted_time = formatter_time.format(mytoday)
print("my sample clock shows: " + formattedtoday_date + " " + formatted_time)
       
C:\Jython\myprojects\testing>jython mytime.py
my sample clock shows: 15/08/2006 16:04:27

More information about formatter patterns, you will find here: http://java.sun.com/j2se/1.5.0/docs/api/
Hope this is useful.

Regards,

Claude

Raghuram Devarakonda <raghu@syncsort.com>  wrote:

Hi,

This might be already known but I am posting it anyway. When I do

os.system("date /t") on windows 2003, I get the following error:
...


Claude Falbriard
Developer
AMS Hortolāndia / SP - Brazil
phone: +55 13 8117 3316
e-mail:  claudef@br.ibm.com